pub struct Migration {
pub id: MigrationId,
pub dependencies: Vec<MigrationId>,
pub operations: Vec<MigrationOperation>,
pub checksum: String,
}Expand description
A declarative schema or SQL migration.
Fields§
§id: MigrationId§dependencies: Vec<MigrationId>§operations: Vec<MigrationOperation>§checksum: StringA legacy user-supplied checksum or a versioned checksum calculated by
Migration::new. New migrations should use the constructor.
Implementations§
Source§impl Migration
impl Migration
Sourcepub fn new(
id: MigrationId,
dependencies: Vec<MigrationId>,
operations: Vec<MigrationOperation>,
) -> Self
pub fn new( id: MigrationId, dependencies: Vec<MigrationId>, operations: Vec<MigrationOperation>, ) -> Self
Creates a migration with a checksum derived from its complete, declarative definition.
Sourcepub fn calculated_checksum(&self) -> String
pub fn calculated_checksum(&self) -> String
Returns the versioned checksum for this migration’s id, dependencies and operations. The encoding preserves operation order and normalizes dependency order.
Trait Implementations§
impl Eq for Migration
impl StructuralPartialEq for Migration
Auto Trait Implementations§
impl Forget for Migration
impl Freeze for Migration
impl Move for Migration
impl RefUnwindSafe for Migration
impl Send for Migration
impl Sync for Migration
impl Unpin for Migration
impl UnsafeUnpin for Migration
impl UnwindSafe for Migration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more