forked from mystiq/dex
Merge pull request #74 from bobbyrullo/db_migrate_redux
db: initialize bigint, boolean columns
This commit is contained in:
commit
5f4fa64214
4 changed files with 12 additions and 6 deletions
|
@ -1,2 +1,4 @@
|
|||
-- +migrate Up
|
||||
ALTER TABLE client_identity ADD COLUMN "dex_admin" boolean;
|
||||
|
||||
UPDATE "client_identity" SET "dex_admin" = false;
|
||||
|
|
|
@ -1,2 +1,4 @@
|
|||
-- +migrate Up
|
||||
ALTER TABLE authd_user ADD COLUMN "created_at" bigint;
|
||||
|
||||
UPDATE authd_user SET "created_at" = 0;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -22,6 +22,8 @@ func initDB(dsn string) *gorp.DbMap {
|
|||
panic(fmt.Sprintf("Unable to drop migration table: %v", err))
|
||||
}
|
||||
|
||||
db.MigrateToLatest(c)
|
||||
if _, err = db.MigrateToLatest(c); err != nil {
|
||||
panic(fmt.Sprintf("Unable to migrate: %v", err))
|
||||
}
|
||||
return c
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue