Trait MigratorTrait

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

Performing migrations on a database

Required Methods§

fn migrations() -> Vec<Box<dyn MigrationTrait>>

Vector of migrations in time sequence

Provided Methods§

fn migration_table_name() -> SeaRc<dyn Iden>

Name of the migration table, it is seaql_migrations by default

fn get_migration_files() -> Vec<Migration>

Get list of migrations wrapped in Migration struct

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

Get list of applied migrations from database

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

Get list of migrations with status

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

Get list of pending migrations

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

Get list of applied migrations

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

Create migration table seaql_migrations in the database

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

Check the status of all migrations

fn fresh<'c, 'async_trait, C>( db: C, ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait>>
where 'c: 'async_trait, C: IntoSchemaManagerConnection<'c> + 'async_trait, Self: 'async_trait,

Drop all tables from the database, then reapply all migrations

fn refresh<'c, 'async_trait, C>( db: C, ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait>>
where 'c: 'async_trait, C: IntoSchemaManagerConnection<'c> + 'async_trait, Self: 'async_trait,

Rollback all applied migrations, then reapply all migrations

fn reset<'c, 'async_trait, C>( db: C, ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait>>
where 'c: 'async_trait, C: IntoSchemaManagerConnection<'c> + 'async_trait, Self: 'async_trait,

Rollback all applied migrations

fn up<'c, 'async_trait, C>( db: C, steps: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait>>
where 'c: 'async_trait, C: IntoSchemaManagerConnection<'c> + 'async_trait, Self: 'async_trait,

Apply pending migrations

fn down<'c, 'async_trait, C>( db: C, steps: Option<u32>, ) -> Pin<Box<dyn Future<Output = Result<(), DbErr>> + Send + 'async_trait>>
where 'c: 'async_trait, C: IntoSchemaManagerConnection<'c> + 'async_trait, Self: 'async_trait,

Rollback applied migrations

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§

Source§

impl MigratorTrait for Migrator

Used to instantiate all tables to generate the corresponding entities in a non-SQLite database (such as Postgres).

Source§

impl MigratorTrait for MigratorChainLogs

Source§

impl MigratorTrait for MigratorIndex

Source§

impl MigratorTrait for MigratorPeers

Source§

impl MigratorTrait for MigratorTickets