Fixed migrations
continuous-integration/drone/push Build is failing Details

This commit is contained in:
kolaente 2019-03-28 08:13:17 +01:00
parent fc92c94e82
commit a227cff23d
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
2 changed files with 3 additions and 4 deletions

View File

@ -35,7 +35,7 @@ func init() {
ID: "20190324205606",
Description: "Remove reminder_unix from tasks",
Migrate: func(tx *xorm.Engine) error {
return dropTableColum(tx, "tasks", "reminder_unix")
return dropTableColum(tx, "tasks", "reminders_unix")
},
Rollback: func(tx *xorm.Engine) error {
return tx.Sync2(tasksReminderDateMigration20190324205606{})

View File

@ -52,7 +52,7 @@ func Migrate(x *xorm.Engine) {
m.InitSchema(initSchema)
err := m.Migrate()
if err != nil {
log.Log.Criticalf("Migration failed: %v", err)
log.Log.Fatalf("Migration failed: %v", err)
}
/*
@ -124,9 +124,8 @@ func dropTableColum(x *xorm.Engine, tableName, col string) error {
case "sqlite":
log.Log.Warning("Unable to drop columns in SQLite")
case "mysql":
_, err := x.Exec("ALTER TABLE ? DROP COLUMN ?", tableName, col)
_, err := x.Exec("ALTER TABLE " + tableName + " DROP COLUMN " + col)
if err != nil {
log.Log.Errorf("Error dropping column: %v", err)
return err
}
default: