Skip to content

Commit

Permalink
All migrations work in sqlite3, mysql and postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
torkelo committed Feb 25, 2015
1 parent 16fd256 commit 563d5e3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ src/css/*.min.css
/grafana

grafana.custom.ini
fig.yml
7 changes: 0 additions & 7 deletions docker/fig.yml

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/services/sqlstore/migrations/user_mig.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func addUserMigrations(mg *Migrator) {
&Column{Name: "org_id", Type: DB_BigInt, Nullable: false},
&Column{Name: "is_admin", Type: DB_Bool, Nullable: false},
&Column{Name: "email_verified", Type: DB_Bool, Nullable: true},
&Column{Name: "theme", Type: DB_NVarchar, Nullable: true},
&Column{Name: "theme", Type: DB_NVarchar, Length: 255, Nullable: true},
&Column{Name: "created", Type: DB_DateTime, Nullable: false},
&Column{Name: "updated", Type: DB_DateTime, Nullable: false},
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/services/sqlstore/migrator/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (mg *Migrator) exec(m Migration) error {
results, err := sess.Query(sql, args...)
if err != nil || len(results) == 0 {
log.Info("Migrator: skipping migration id: %v, condition not fulfilled", m.Id())
return nil
return sess.Rollback()
}
}

Expand Down

0 comments on commit 563d5e3

Please sign in to comment.