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

This commit is contained in:
wizardchen
2025-12-16 12:07:25 +08:00
committed by lyingbug
parent 95dfcf81cd
commit 36f0968df0
+1 -1
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,
}