feat: 修复数据库迁移中AUTO_RECOVER_DIRTY环境变量判断逻辑,默认启用自动恢复

main
wizardchen 2025-12-16 12:07:25 +08:00 committed by lyingbug
parent 95dfcf81cd
commit 36f0968df0
1 changed files with 1 additions and 1 deletions

View File

@ -292,7 +292,7 @@ func initDatabase(cfg *config.Config) (*gorm.DB, error) {
if os.Getenv("AUTO_MIGRATE") != "false" {
logger.Infof(context.Background(), "Running database migrations...")
autoRecover := os.Getenv("AUTO_RECOVER_DIRTY") == "true"
autoRecover := os.Getenv("AUTO_RECOVER_DIRTY") != "false"
migrationOpts := database.MigrationOptions{
AutoRecoverDirty: autoRecover,
}