ORM-13: Implement Migrator::rollback(steps) #13
Labels
No labels
area:core
area:database
area:migrations
area:model
area:relations
area:schema
area:tests
breaking-change
size:M
size:S
tracking
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
NoctisWolfshadow/tessera-orm#13
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Depends on: #11
Context
Down migrations are optional, so rollback has to fail early and cleanly when one is missing instead of stopping halfway.
Tasks
stepsapplied migrations exist in the list and all havedown; otherwise return an error before changing anything.downin descending order, each in its own transaction, deleting its tracking row. Honourrebuilds_tablesthrough the shared function from #12.Example
Acceptance criteria
downreturns an error with the database unchanged.run()after a rollback re-applies the rolled-back migrations.rebuilds_tablesmigrations (foreign-key-safe) #12