mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-09-20 13:30:51 +02:00
- Introduced a new migration (011a_recover_transfer_configs_rename) to check and recover the transfer_configs table if it was incorrectly renamed to _transfer_configs_old during a previous migration. - Implemented logic to handle various states of the tables, including logging warnings for potential issues. - Ensured that the migration can be safely added to the existing migration sequence. This migration enhances the robustness of the database migration process by addressing potential inconsistencies.
32 lines
939 B
Go
32 lines
939 B
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
|
|
AlterBooleanDefaults(), // 012
|
|
CleanupInvalidBooleans(), // 013
|
|
)
|
|
|
|
return gormigrate.New(db, gormigrate.DefaultOptions, migrations)
|
|
}
|