1Panel/core/init/migration/migrate.go
ssongliu 9cdc4a7303
Some checks failed
sync2gitee / repo-sync (push) Failing after -6m54s
feat: agent 功能代码拆分
2024-07-22 16:14:59 +08:00

20 lines
458 B
Go

package migration
import (
"github.com/1Panel-dev/1Panel/core/global"
"github.com/1Panel-dev/1Panel/core/init/migration/migrations"
"github.com/go-gormigrate/gormigrate/v2"
)
func Init() {
m := gormigrate.New(global.DB, gormigrate.DefaultOptions, []*gormigrate.Migration{
migrations.AddTable,
migrations.InitSetting,
})
if err := m.Migrate(); err != nil {
global.LOG.Error(err)
panic(err)
}
global.LOG.Info("Migration run successfully")
}