2022-08-16 15:30:23 +00:00
|
|
|
package migration
|
|
|
|
|
|
|
|
import (
|
2022-10-17 08:32:31 +00:00
|
|
|
"github.com/1Panel-dev/1Panel/backend/global"
|
|
|
|
"github.com/1Panel-dev/1Panel/backend/init/migration/migrations"
|
2022-08-16 15:30:23 +00:00
|
|
|
|
|
|
|
"github.com/go-gormigrate/gormigrate/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
func Init() {
|
|
|
|
m := gormigrate.New(global.DB, gormigrate.DefaultOptions, []*gormigrate.Migration{
|
|
|
|
migrations.AddTableOperationLog,
|
2022-08-18 10:54:21 +00:00
|
|
|
migrations.AddTableHost,
|
2022-09-15 02:44:43 +00:00
|
|
|
migrations.AddTableMonitor,
|
|
|
|
migrations.AddTableSetting,
|
2022-09-16 10:53:45 +00:00
|
|
|
migrations.AddTableBackupAccount,
|
2022-09-20 11:12:48 +00:00
|
|
|
migrations.AddTableCronjob,
|
2022-09-22 08:16:04 +00:00
|
|
|
migrations.AddTableApp,
|
2022-10-09 08:17:15 +00:00
|
|
|
migrations.AddTableImageRepo,
|
2022-10-28 09:04:57 +00:00
|
|
|
migrations.AddTableWebsite,
|
2022-10-20 10:45:47 +00:00
|
|
|
migrations.AddTableDatabaseMysql,
|
2023-01-09 14:55:10 +00:00
|
|
|
migrations.AddTableSnap,
|
2023-03-22 13:42:30 +00:00
|
|
|
migrations.AddDefaultGroup,
|
2023-03-29 06:58:28 +00:00
|
|
|
migrations.AddTableRuntime,
|
2023-04-08 06:02:14 +00:00
|
|
|
migrations.UpdateTableApp,
|
2023-04-10 13:50:24 +00:00
|
|
|
migrations.UpdateTableHost,
|
2023-04-12 13:52:30 +00:00
|
|
|
migrations.UpdateTableWebsite,
|
2023-04-25 06:34:16 +00:00
|
|
|
migrations.AddEntranceAndSSL,
|
2023-05-15 14:40:05 +00:00
|
|
|
migrations.UpdateTableSetting,
|
|
|
|
migrations.UpdateTableAppDetail,
|
2023-05-19 13:47:46 +00:00
|
|
|
migrations.AddBindAndAllowIPs,
|
2023-05-24 10:36:41 +00:00
|
|
|
migrations.UpdateCronjobWithSecond,
|
2023-05-30 06:22:57 +00:00
|
|
|
migrations.UpdateWebsite,
|
2023-06-23 15:06:13 +00:00
|
|
|
migrations.AddBackupAccountDir,
|
2023-06-25 09:52:13 +00:00
|
|
|
migrations.AddMfaInterval,
|
2023-07-03 08:36:18 +00:00
|
|
|
migrations.UpdateAppDetail,
|
2023-07-03 08:48:14 +00:00
|
|
|
migrations.EncryptHostPassword,
|
2023-07-19 08:25:41 +00:00
|
|
|
migrations.AddRemoteDB,
|
2023-08-03 10:36:01 +00:00
|
|
|
migrations.UpdateRedisParam,
|
2023-08-09 06:14:12 +00:00
|
|
|
migrations.UpdateCronjobWithDb,
|
2023-08-15 14:48:11 +00:00
|
|
|
migrations.AddTableFirewall,
|
2023-09-01 15:10:14 +00:00
|
|
|
migrations.AddDatabases,
|
2023-08-29 02:50:15 +00:00
|
|
|
migrations.UpdateDatabase,
|
2023-08-31 07:14:11 +00:00
|
|
|
migrations.UpdateAppInstallResource,
|
2023-09-14 14:50:13 +00:00
|
|
|
migrations.DropDatabaseLocal,
|
2023-09-18 09:22:21 +00:00
|
|
|
|
|
|
|
migrations.AddDefaultNetwork,
|
2023-09-25 09:50:14 +00:00
|
|
|
migrations.UpdateRuntime,
|
2023-10-08 06:54:14 +00:00
|
|
|
migrations.UpdateTag,
|
2023-10-25 02:41:26 +00:00
|
|
|
|
2023-10-20 09:56:46 +00:00
|
|
|
migrations.AddFavorite,
|
2023-10-25 02:41:26 +00:00
|
|
|
migrations.AddBindAddress,
|
2023-10-31 06:14:30 +00:00
|
|
|
migrations.AddCommandGroup,
|
2023-11-03 10:18:12 +00:00
|
|
|
migrations.AddAppSyncStatus,
|
2023-11-14 10:44:09 +00:00
|
|
|
|
|
|
|
migrations.UpdateAcmeAccount,
|
2023-11-20 02:44:10 +00:00
|
|
|
migrations.UpdateWebsiteSSL,
|
2023-11-27 04:04:09 +00:00
|
|
|
migrations.AddWebsiteCA,
|
2023-11-28 07:00:10 +00:00
|
|
|
migrations.AddDockerSockPath,
|
2023-11-29 02:46:07 +00:00
|
|
|
migrations.AddDatabaseSSL,
|
2023-11-29 14:04:08 +00:00
|
|
|
migrations.AddDefaultCA,
|
2023-12-04 06:56:09 +00:00
|
|
|
migrations.AddSettingRecycleBin,
|
2023-12-18 09:54:15 +00:00
|
|
|
migrations.UpdateWebsiteBackupRecord,
|
2024-01-02 13:54:28 +00:00
|
|
|
|
|
|
|
migrations.AddTablePHPExtensions,
|
2024-01-07 14:52:41 +00:00
|
|
|
migrations.AddTableDatabasePostgresql,
|
2024-01-09 04:43:33 +00:00
|
|
|
migrations.AddPostgresqlSuperUser,
|
2024-01-11 03:01:40 +00:00
|
|
|
migrations.UpdateCronjobWithWebsite,
|
2024-01-19 08:48:41 +00:00
|
|
|
migrations.UpdateOneDriveToken,
|
2024-01-22 14:29:19 +00:00
|
|
|
migrations.UpdateCronjobSpec,
|
2024-01-24 09:41:56 +00:00
|
|
|
migrations.UpdateBackupRecordPath,
|
2024-01-25 05:55:11 +00:00
|
|
|
migrations.UpdateSnapshotRecords,
|
2024-02-05 09:28:12 +00:00
|
|
|
|
|
|
|
migrations.UpdateWebDavConf,
|
2024-03-12 03:04:08 +00:00
|
|
|
|
|
|
|
migrations.AddSnapshotIgnore,
|
2024-03-14 10:22:07 +00:00
|
|
|
migrations.AddDatabaseIsDelete,
|
2024-04-03 06:11:12 +00:00
|
|
|
migrations.AddXpackHideMenu,
|
2024-04-03 08:50:07 +00:00
|
|
|
migrations.AddCronjobCommand,
|
2024-04-08 05:48:07 +00:00
|
|
|
migrations.NewMonitorDB,
|
2024-04-09 14:46:09 +00:00
|
|
|
migrations.AddNoAuthSetting,
|
2024-04-11 06:16:10 +00:00
|
|
|
migrations.UpdateXpackHideMenu,
|
2024-04-15 07:10:24 +00:00
|
|
|
migrations.AddMenuTabsSetting,
|
2024-04-24 15:12:12 +00:00
|
|
|
migrations.AddDeveloperSetting,
|
2024-05-07 10:26:34 +00:00
|
|
|
|
|
|
|
migrations.AddWebsiteSSLColumn,
|
2024-05-15 15:02:35 +00:00
|
|
|
migrations.AddRedisCommand,
|
2024-05-17 09:54:38 +00:00
|
|
|
migrations.AddMonitorMenu,
|
2024-05-17 14:36:38 +00:00
|
|
|
migrations.AddFtp,
|
2024-05-29 03:05:09 +00:00
|
|
|
migrations.AddProxy,
|
2024-06-04 08:48:31 +00:00
|
|
|
migrations.AddCronJobColumn,
|
2022-08-16 15:30:23 +00:00
|
|
|
})
|
|
|
|
if err := m.Migrate(); err != nil {
|
|
|
|
global.LOG.Error(err)
|
|
|
|
panic(err)
|
|
|
|
}
|
2023-03-01 10:17:31 +00:00
|
|
|
global.LOG.Info("Migration run successfully")
|
2022-08-16 15:30:23 +00:00
|
|
|
}
|