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

feat(ci): add command to rollback migrations #4768

Merged
merged 6 commits into from
Oct 30, 2024

Conversation

matthewelwell
Copy link
Contributor

@matthewelwell matthewelwell commented Oct 24, 2024

Changes

This PR adds a new management command that will unapply all migrations applied after a given date. This is useful in rollback scenarios where we want to be able to rollback to a previous version of the flagsmith application and it is not possible to run it against the migrated database.

How did you test this code?

Ran the command manually a few times, rolling migrations backwards and forwards.

Added some unit tests to exercise the new command.

Copy link

vercel bot commented Oct 24, 2024

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 30, 2024 3:23pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview Oct 30, 2024 3:23pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview Oct 30, 2024 3:23pm

@github-actions github-actions bot added api Issue related to the REST API feature New feature or request labels Oct 24, 2024
Copy link
Contributor

github-actions bot commented Oct 24, 2024

Uffizzi Preview deployment-57582 was deleted.

Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.32%. Comparing base (8fbc662) to head (b5852da).
Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4768      +/-   ##
==========================================
+ Coverage   97.30%   97.32%   +0.02%     
==========================================
  Files        1173     1178       +5     
  Lines       40835    41161     +326     
==========================================
+ Hits        39733    40061     +328     
+ Misses       1102     1100       -2     

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

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Oct 29, 2024
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Oct 30, 2024
@github-actions github-actions bot added docs Documentation updates feature New feature or request and removed feature New feature or request docs Documentation updates labels Oct 30, 2024
@matthewelwell matthewelwell changed the title feat(ci): WIP - add command to rollback migrations feat(ci): add command to rollback migrations Oct 30, 2024
@matthewelwell matthewelwell marked this pull request as ready for review October 30, 2024 15:24
@matthewelwell matthewelwell requested review from a team as code owners October 30, 2024 15:24
@matthewelwell matthewelwell removed the request for review from a team October 30, 2024 15:24
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Oct 30, 2024
Copy link
Contributor

github-actions bot commented Oct 30, 2024

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-4768 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api-test:pr-4768 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-frontend:pr-4768 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-api:pr-4768 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-4768 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-4768 Finished ✅ Results

@matthewelwell matthewelwell added this pull request to the merge queue Oct 30, 2024
Merged via the queue into main with commit 483cc87 Oct 30, 2024
56 checks passed
@matthewelwell matthewelwell deleted the feat/add-command-to-rollback-migrations branch October 30, 2024 18:00
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 feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants