database_tasks should control whether Database::BatchedBackgroundMigration::CiDatabaseWorker runs

This should help with #359951 (closed) as we already need to switch this from false to true after the failover. And this is conceptually sound as this is a migration task.

We can just swap the feature flag for checking database_tasks value https://gitlab.com/gitlab-org/gitlab/-/blob/fa1ecae9439743adfe5076023970e3bb35f55841/app/workers/database/batched_background_migration/ci_database_worker.rb#L8 . This won't allow dynamically enabling and will only enable after a restart but we will need to redeploy for database_tasks to be honored anyway. It's also not time sensitive since the background migrations can be delayed so it can be switched on at the next deploy after failover.

Proposal

  1. !86525 (merged) should handle whether Database::BatchedBackgroundMigration::CiDatabaseWorker runs, or not, based on database_tasks.

  2. Remove the execute_batched_migrations_on_schedule_ci_database flag. Either remove it outright, or merge with execute_batched_migrations_on_schedule flag

Edited by Krasimir Angelov