mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-09-08 15:41:20 +02:00
- Introduced two new migrations (011b_recover_notification_services_rename and 011c_recover_auth_providers_rename) to check and recover the notification_services and auth_providers tables if they were incorrectly renamed during a previous migration. - Implemented logic to handle various states of the tables, including logging warnings for potential issues and ensuring safe recovery actions. - Updated the migration sequence to include these new recovery steps, enhancing the robustness of the database migration process.
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
package migrations
|
|
|
|
import (
|
|
"github.com/go-gormigrate/gormigrate/v2"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
var migrations []*gormigrate.Migration
|
|
|
|
// GetMigrations returns all migrations
|
|
func GetMigrations(db *gorm.DB) *gormigrate.Gormigrate {
|
|
// Add all migrations in order
|
|
migrations = append(migrations,
|
|
InitialSchema(), // 001
|
|
UpdateGDriveType(), // 002
|
|
Add2FA(), // 003
|
|
AddAuditLogs(), // 004
|
|
AddDefaultRoles(), // 005
|
|
AddTimestampsToJobHistories(), // 006
|
|
AddNotificationServices(), // 007
|
|
AddUserNotifications(), // 008
|
|
AddRcloneTables(), // 009
|
|
AddRcloneCommandToConfig(), // 010
|
|
AddAuthProviders(), // 011
|
|
RecoverTransferConfigsRename(), // 011a
|
|
RecoverNotificationServicesRename(), // 011b
|
|
RecoverAuthProvidersRename(), // 011c
|
|
AlterBooleanDefaults(), // 012
|
|
CleanupInvalidBooleans(), // 013
|
|
)
|
|
|
|
return gormigrate.New(db, gormigrate.DefaultOptions, migrations)
|
|
}
|