feat!: Add support for rolling back migrations#583
Open
ElijahAhianyo wants to merge 13 commits into
Open
Conversation
|
| Branch | elijah/migrations-rollback |
| Testbed | github-ubuntu-latest |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result microseconds (µs) (Result Δ%) | Upper Boundary microseconds (µs) (Limit %) |
|---|---|---|---|
| empty_router/empty_router | 📈 view plot 🚷 view threshold | 5,490.80 µs(-10.98%)Baseline: 6,168.10 µs | 7,754.14 µs (70.81%) |
| json_api/json_api | 📈 view plot 🚷 view threshold | 919.35 µs(-14.94%)Baseline: 1,080.84 µs | 1,322.26 µs (69.53%) |
| nested_routers/nested_routers | 📈 view plot 🚷 view threshold | 847.31 µs(-15.25%)Baseline: 999.76 µs | 1,202.64 µs (70.45%) |
| single_root_route/single_root_route | 📈 view plot 🚷 view threshold | 812.91 µs(-15.53%)Baseline: 962.36 µs | 1,165.95 µs (69.72%) |
| single_root_route_burst/single_root_route_burst | 📈 view plot 🚷 view threshold | 17,852.00 µs(+1.01%)Baseline: 17,674.11 µs | 21,077.68 µs (84.70%) |
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
Related issue or discussion
fixes #547
Description
This allows rolling back migrations to the specified migration file.
Assuming the project has the following migration files in its migration dir:
The above command will roll back(unapply) the
m_0002_secondfile, leavingm_0001_initialapplied.Alternatively, the migration file number can be used for convenience:
Migrations are currently tied to a crate(the crate name is used), which means rolling back a migration in a project that imports apps from external crates will implicitly (and only) rollback migrations in the current project/crate. This might change when support for workspaces is added
As a bonus, this PR also adds CLI Group tasks as a means to group nested related subcommands under a parent subcommand:
Eg.
Results in the following
Type of change