fix(migrations): Fix tags migrations #3419
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingdocs/
if required so people know about the feature!Changes
Motivation behind this PR
Migrations are currently failing on any existing database (note that it seems that they work on new databases, e.g. for running tests).
Implementation
Removes steps from a migrations file in the tags project which created the new column as nullable, manually populated the defaults and then set the column to not null.
The reason I added this originally is that, technically, adding a new non-nullable column to a table requires acquiring a temporary lock on the table I believe. Since the tags table is small enough in production however (~3000 records), I think we can not worry about this.
How did you test this code?
Reproduced the migration error locally, changed the migration file and re ran to confirm the issue is fixed.