Skip to main content

Migration

Trait Migration 

Source
pub trait Migration:
    Send
    + Sync
    + 'static {
    // Required methods
    fn version(&self) -> u64;
    fn name(&self) -> &'static str;
    fn up(&self) -> &'static str;

    // Provided method
    fn checksum(&self) -> u64 { ... }
}

Required Methods§

Source

fn version(&self) -> u64

Monotonic version, e.g. 2026_0611_0001. Duplicates are rejected at registration.

Source

fn name(&self) -> &'static str

Source

fn up(&self) -> &'static str

One SQL statement.

Provided Methods§

Source

fn checksum(&self) -> u64

FNV-1a of up() — stored in the ledger; mismatch on a later boot is schema drift and fails the boot.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§