2021-04-11 13:42:43 +03:00
|
|
|
package migrations
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/emvi/logbuch"
|
|
|
|
"github.com/muety/wakapi/config"
|
|
|
|
"gorm.io/gorm"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
const name = "20210411-drop_migrations_table"
|
|
|
|
f := migrationFunc{
|
|
|
|
name: name,
|
|
|
|
f: func(db *gorm.DB, cfg *config.Config) error {
|
2021-04-12 23:58:40 +03:00
|
|
|
if err := db.Migrator().DropTable("gorp_migrations"); err != nil {
|
|
|
|
logbuch.Info("dropped table 'gorp_migrations'")
|
2021-04-11 13:42:43 +03:00
|
|
|
}
|
2021-04-12 23:58:40 +03:00
|
|
|
return nil
|
2021-04-11 13:42:43 +03:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
registerPostMigration(f)
|
|
|
|
}
|