1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: table drop in migration

This commit is contained in:
Ferdinand Mütsch 2021-04-12 22:58:40 +02:00
parent 915436822b
commit 7ab9c45f4f

View File

@ -11,14 +11,10 @@ func init() {
f := migrationFunc{
name: name,
f: func(db *gorm.DB, cfg *config.Config) error {
migrator := db.Migrator()
if !migrator.HasTable("gorp_migrations") {
return nil
if err := db.Migrator().DropTable("gorp_migrations"); err != nil {
logbuch.Info("dropped table 'gorp_migrations'")
}
logbuch.Info("dropping table 'gorp_migrations'")
return migrator.DropTable("gorp_migrations")
return nil
},
}