feat: fine-grained migration step control (closes #86)#92
Merged
Conversation
…downgrade_one, downgrade_to, current_revision (#86)
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
upgrade_to(revision)— upgrade to a specific revisionupgrade_one()— upgrade exactly one step (+1)downgrade_one()— downgrade exactly one step (-1)downgrade_to(revision)— downgrade to a specific revisioncurrent_revision()— return current Alembic revision (None if at base)Closes #86. Achieves pytest-alembic parity for the data migration testing pattern:
Test plan
test_upgrade_to— upgrades to specific revision, not beyondtest_upgrade_one— single-step advance from mid-chaintest_downgrade_one— single-step rollbacktest_downgrade_to— rollback to specific revisiontest_current_revision— tracks current revision through stepstest_step_control_data_migration_pattern— end-to-end: seed at mid-point, verify data survives further upgrade