2024-07-19 19:04:11 +08:00
|
|
|
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{
|
2024-07-22 16:14:59 +08:00
|
|
|
migrations.AddTable,
|
2024-07-19 19:04:11 +08:00
|
|
|
migrations.InitSetting,
|
2024-08-08 15:38:37 +08:00
|
|
|
migrations.InitOneDrive,
|
2024-08-14 10:15:55 +08:00
|
|
|
migrations.InitMasterAddr,
|
2024-08-19 18:04:43 +08:00
|
|
|
migrations.InitHost,
|
2024-08-22 18:46:54 +08:00
|
|
|
migrations.InitTerminalSetting,
|
2024-10-30 15:58:40 +08:00
|
|
|
migrations.InitAppLauncher,
|
2024-11-06 17:37:14 +08:00
|
|
|
migrations.InitBackup,
|
2024-11-12 13:35:12 +08:00
|
|
|
migrations.InitGoogle,
|
2024-07-19 19:04:11 +08:00
|
|
|
})
|
|
|
|
if err := m.Migrate(); err != nil {
|
|
|
|
global.LOG.Error(err)
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
global.LOG.Info("Migration run successfully")
|
|
|
|
}
|