fix(postgres): fixed issue with postgres caused by wrong prefrences table types, dropped table and created it with correct column types, fixes #4558

This commit is contained in:
Torkel Ödegaard
2016-04-05 11:24:08 -04:00
parent 676e950fa3
commit 9b30634217
4 changed files with 16 additions and 8 deletions
@@ -10,12 +10,12 @@ func addPreferencesMigrations(mg *Migrator) {
Name: "preferences",
Columns: []*Column{
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "org_id", Type: DB_Int, Nullable: true},
{Name: "user_id", Type: DB_NVarchar, Length: 255, Nullable: true},
{Name: "org_id", Type: DB_BigInt, Nullable: false},
{Name: "user_id", Type: DB_BigInt, Nullable: false},
{Name: "version", Type: DB_Int, Nullable: false},
{Name: "home_dashboard_id", Type: DB_BigInt, Nullable: true},
{Name: "timezone", Type: DB_NVarchar, Length: 50, Nullable: true},
{Name: "theme", Type: DB_NVarchar, Length: 20, Nullable: true},
{Name: "home_dashboard_id", Type: DB_BigInt, Nullable: false},
{Name: "timezone", Type: DB_NVarchar, Length: 50, Nullable: false},
{Name: "theme", Type: DB_NVarchar, Length: 20, Nullable: false},
{Name: "created", Type: DB_DateTime, Nullable: false},
{Name: "updated", Type: DB_DateTime, Nullable: false},
},
@@ -25,6 +25,8 @@ func addPreferencesMigrations(mg *Migrator) {
},
}
mg.AddMigration("drop preferences table v3", NewDropTableMigration("preferences"))
// create table
mg.AddMigration("create preferences table v2", NewAddTableMigration(preferencesV2))
mg.AddMigration("create preferences table v3", NewAddTableMigration(preferencesV2))
}