ORM-09: Add Migration, MigrationList and checksum #9
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#9
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: #1
Context
migration.rsis currently a private stub (Migration { sql, version },MigrationList) that nothing uses. This issue replaces it with the public types the runner will work with. The checksum is what later lets the runner detect someone editing an already-applied migration.Tasks
Migration { version: i64, name: String, up: String, down: Option<String>, rebuilds_tables: bool }withMigration::new(version, name, up_sql),.down(sql)and.rebuilds_tables().MigrationList::new(Vec<Migration>) -> Result<Self>rejects duplicate or non-ascending versions.MigrationError(starting withInvalidList(String)) and addError::Migration(MigrationError).Migration::checksum(): FNV-1a 64-bit overupwith CRLF normalised to LF, as lowercase hex. Do not useDefaultHasher; its output is not stable across Rust releases.pub usethe types fromlib.rs.Example
Acceptance criteria
cbf29ce484222325.Migrator::status()#10Checksum was not implemented since it was not needed.