pub trait MigratorTrait: Send {
Show 13 methods // Required method fn migrations() -> Vec<Box<dyn MigrationTrait + 'static, Global>, Global>; // Provided methods fn get_migration_files() -> Vec<Migration, Global> { ... } fn get_migration_models<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<Vec<Model, Global>, DbErr>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn get_migration_with_status<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<Vec<Migration, Global>, DbErr>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn get_pending_migrations<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<Vec<Migration, Global>, DbErr>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn get_applied_migrations<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<Vec<Migration, Global>, DbErr>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn install<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait, Global>> where 'life0: 'async_trait { ... } fn fresh<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn refresh<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn reset<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn status<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn up<'life0, 'async_trait>( db: &'life0 DatabaseConnection, steps: Option<u32> ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait { ... } fn down<'life0, 'async_trait>( db: &'life0 DatabaseConnection, steps: Option<u32> ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait, Global>> where 'life0: 'async_trait, Self: 'async_trait { ... }
}
Expand description

Performing migrations on a database

Required Methods§

source

fn migrations() -> Vec<Box<dyn MigrationTrait + 'static, Global>, Global>

Vector of migrations in time sequence

Provided Methods§

source

fn get_migration_files() -> Vec<Migration, Global>

Get list of migrations wrapped in Migration struct

source

fn get_migration_models<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<Vec<Model, Global>, DbErr>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Get list of applied migrations from database

source

fn get_migration_with_status<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<Vec<Migration, Global>, DbErr>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Get list of migrations with status

source

fn get_pending_migrations<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<Vec<Migration, Global>, DbErr>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Get list of pending migrations

source

fn get_applied_migrations<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<Vec<Migration, Global>, DbErr>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Get list of applied migrations

source

fn install<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait, Global>>where 'life0: 'async_trait,

Create migration table seaql_migrations in the database

source

fn fresh<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Drop all tables from the database, then reapply all migrations

source

fn refresh<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Rollback all applied migrations, then reapply all migrations

source

fn reset<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Rollback all applied migrations

source

fn status<'life0, 'async_trait>( db: &'life0 DatabaseConnection ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Check the status of all migrations

source

fn up<'life0, 'async_trait>( db: &'life0 DatabaseConnection, steps: Option<u32> ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Apply pending migrations

source

fn down<'life0, 'async_trait>( db: &'life0 DatabaseConnection, steps: Option<u32> ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, Self: 'async_trait,

Rollback applied migrations

Implementors§