1Panel/core/init/migration/migrate.go
ssongliu 03e9077c9a
Some checks failed
sync2gitee / repo-sync (push) Has been cancelled
feat: 备份账号增加 Google Drive (#7004)
2024-11-12 13:35:12 +08:00

28 lines
651 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,
migrations.InitOneDrive,
migrations.InitMasterAddr,
migrations.InitHost,
migrations.InitTerminalSetting,
migrations.InitAppLauncher,
migrations.InitBackup,
migrations.InitGoogle,
})
if err := m.Migrate(); err != nil {
global.LOG.Error(err)
panic(err)
}
global.LOG.Info("Migration run successfully")
}