ORM-10: Add the migration tracking table and Migrator::status() #10
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#10
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: #6, #9
Context
The runner needs to know which migrations were applied, and whether they still match what is in the code. A tracking table (rather than
PRAGMA user_version) can store the name and checksum, which is what makes drift detectable.Tasks
Migrator::new(MigrationList).IF NOT EXISTS), created on first use.Migrator::status() -> Result<Vec<MigrationStatus>>, ascending by version, covering migrations from the list and rows recorded in the database.Applied,Pending,Modified(checksum differs),Missing(recorded in the database but absent from the list).Example
Acceptance criteria
Applied,Pending,Modified,Missing).status()on a fresh database creates the table and reports everything asPending.Migrator::run()#11