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:
parent
915436822b
commit
7ab9c45f4f
@ -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
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user