From ed04c03bb8a315c80a126d7d9ae4f4ce6b9bb42e Mon Sep 17 00:00:00 2001 From: Dylan Griffith <dyl.griffith@gmail.com> Date: Tue, 27 Feb 2024 16:30:09 +1100 Subject: [PATCH] Don't force when generating background migration in housekeeper This `force: true` option seems to generate the migration even if there is an existing migration with the exact same name. Additionally it deletes the existing migration with the same name. This is probably not something we ever intended to do so I'm removing it. At some point we may want to update this to skip finalizing a BBM if a migration with a matching name exists (or generate a guaranteed unique name) but it's not clear to me if we actually have a use case for this now. Also there are plans to be more strict about not re-using batched background migrations so possibly the matching name won't be very common in future. --- keeps/overdue_finalize_background_migration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keeps/overdue_finalize_background_migration.rb b/keeps/overdue_finalize_background_migration.rb index f56789b6da87e..0cd669ecb1bb1 100644 --- a/keeps/overdue_finalize_background_migration.rb +++ b/keeps/overdue_finalize_background_migration.rb @@ -77,7 +77,7 @@ def each_change migration_name = truncate_migration_name("Finalize#{migration['migration_job_name']}") PostDeploymentMigration::PostDeploymentMigrationGenerator .source_root('generator_templates/post_deployment_migration/post_deployment_migration/') - generator = ::PostDeploymentMigration::PostDeploymentMigrationGenerator.new([migration_name], force: true) + generator = ::PostDeploymentMigration::PostDeploymentMigrationGenerator.new([migration_name]) migration_file = generator.invoke_all.first change.changed_files = [migration_file] -- GitLab