mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
ref: embed files, bump to go 1.16 (#167)
* ref: embed portion of files * fix: readd pkger * ref: embed version.txt * fix: wrong mail template import path * refactor: get rid of sql-migrate refactor: get rid of pkger in favor of go embed (resolve #164) * chore: remove unused var [ci-skip] Co-authored-by: Ferdinand Mütsch <ferdinand@muetsch.io>
This commit is contained in:
26
migrations/20210411_drop_migrations_table.go
Normal file
26
migrations/20210411_drop_migrations_table.go
Normal file
@ -0,0 +1,26 @@
|
||||
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 {
|
||||
migrator := db.Migrator()
|
||||
|
||||
if !migrator.HasTable("gorp_migrations") {
|
||||
return nil
|
||||
}
|
||||
|
||||
logbuch.Info("dropping table 'gorp_migrations'")
|
||||
return migrator.DropTable("gorp_migrations")
|
||||
},
|
||||
}
|
||||
|
||||
registerPostMigration(f)
|
||||
}
|
Reference in New Issue
Block a user