Skip to content
Snippets Groups Projects
Unverified Commit 7a90a76e authored by Prabakaran Murugesan's avatar Prabakaran Murugesan Committed by GitLab
Browse files

Merge branch 'bwill/document-bbm-code-deletion' into 'master'

parents 64f0f569 be646fab
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -292,11 +292,27 @@ the migration that was used to enqueue it. Pay careful attention to:
When finalizing a batched background migration you also need to update the
`finalized_by` in the corresponding `db/docs/batched_background_migrations`
file. The value should be the timestamp/version of the migration you added to
finalize it.
finalize it. The [schema version of the RSpec tests](../testing_guide/testing_migrations_guide.md#testing-a-non-activerecordmigration-class)
associated with the migration should also be set to this version to avoid having the tests fail due
to future schema changes.
 
See the below [Examples](#examples) for specific details on what the actual
migration code should be.
 
### Deleting batched background migration code
Once a batched background migration has been finalized, the migration code in `lib/gitlab/background_migration/`
and its associated tests can be deleted after the next required stop following the finalization.
Here is an example scenario:
- 17.2 and 17.5 are required stops.
- In 17.0 the batched background migration is queued.
- In 17.3 the migration may be finalized, provided that it's completed in GitLab.com.
- In 17.6 the code related to the migration may be deleted.
Batched background migration code is routinely deleted when migrations are squashed.
### Use job arguments
 
`BatchedMigrationJob` provides the `job_arguments` helper method for job classes to define the job arguments they need.
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment