feat: 修复数据库迁移中AUTO_RECOVER_DIRTY环境变量判断逻辑,默认启用自动恢复
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user