Skip to main content

Migration

Trait Migration 

Source
pub trait Migration: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn version(&self) -> &str;
    async fn up(&self, manager: &SchemaManager<'_>) -> Result<(), DbErr>;
    async fn down(&self, manager: &SchemaManager<'_>) -> Result<(), DbErr>;
}
Expand description

Migration abstraction mirroring sea-orm-migration with an explicit version.

Required Methods§

Source

fn name(&self) -> &str

Returns the migration name.

Source

fn version(&self) -> &str

Returns the migration version.

Source

async fn up(&self, manager: &SchemaManager<'_>) -> Result<(), DbErr>

Applies the migration.

Source

async fn down(&self, manager: &SchemaManager<'_>) -> Result<(), DbErr>

Rolls the migration back.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§