Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(migrations): Fix tags migrations #3419

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

matthewelwell
Copy link
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • I have run pre-commit to check linting
  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

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.

@matthewelwell matthewelwell requested review from a team and gagantrivedi and removed request for a team February 14, 2024 13:45
Copy link

vercel bot commented Feb 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Feb 14, 2024 1:46pm
flagsmith-frontend-preview ✅ Ready (Inspect) Visit Preview Feb 14, 2024 1:46pm
flagsmith-frontend-staging ✅ Ready (Inspect) Visit Preview Feb 14, 2024 1:46pm

@github-actions github-actions bot added the api Issue related to the REST API label Feb 14, 2024
Copy link
Contributor

github-actions bot commented Feb 14, 2024

Uffizzi Preview deployment-46560 was deleted.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c666d29) 95.91% compared to head (2c0f79f) 95.91%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3419      +/-   ##
==========================================
- Coverage   95.91%   95.91%   -0.01%     
==========================================
  Files        1085     1085              
  Lines       33677    33675       -2     
==========================================
- Hits        32302    32300       -2     
  Misses       1375     1375              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@zachaysan zachaysan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR makes sense and yeah with only that few number of records it should be fast enough.

@matthewelwell matthewelwell added this pull request to the merge queue Feb 14, 2024
Merged via the queue into main with commit f1ebdf5 Feb 14, 2024
21 checks passed
@matthewelwell matthewelwell deleted the fix(migrations)/fix-tags-migration branch February 14, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants