Skip to main content

DynMigration

Trait DynMigration 

Source
pub trait DynMigration {
    // Required methods
    fn app_name(&self) -> &str;
    fn name(&self) -> &str;
    fn dependencies(&self) -> &[MigrationDependency];
    fn operations(&self) -> &[Operation];
}
Available on crate feature db only.
Expand description

A trait for defining a migration that can be dynamically applied.

This is mostly useful for use in the MigrationEngine to allow migrations to be dynamically loaded from multiple apps. This can also be used to implement custom migration loading logic, or to implement migrations that are not statically defined.

This trait has a blanket implementation for types that implement Migration.

Required Methods§

Source

fn app_name(&self) -> &str

The name of the app that this migration belongs to.

Source

fn name(&self) -> &str

The name of the migration.

Source

fn dependencies(&self) -> &[MigrationDependency]

The list of dependencies of the migration.

Source

fn operations(&self) -> &[Operation]

The list of operations to apply in the migration.

Trait Implementations§

Source§

impl DynMigration for &dyn DynMigration

Source§

fn app_name(&self) -> &str

The name of the app that this migration belongs to.
Source§

fn name(&self) -> &str

The name of the migration.
Source§

fn dependencies(&self) -> &[MigrationDependency]

The list of dependencies of the migration.
Source§

fn operations(&self) -> &[Operation]

The list of operations to apply in the migration.
Source§

impl DynMigration for Box<dyn DynMigration>

Source§

fn app_name(&self) -> &str

The name of the app that this migration belongs to.
Source§

fn name(&self) -> &str

The name of the migration.
Source§

fn dependencies(&self) -> &[MigrationDependency]

The list of dependencies of the migration.
Source§

fn operations(&self) -> &[Operation]

The list of operations to apply in the migration.

Implementations on Foreign Types§

Source§

impl DynMigration for Box<SyncDynMigration>

Source§

impl DynMigration for Box<dyn DynMigration>

Implementors§

Source§

impl DynMigration for &SyncDynMigration

Source§

impl DynMigration for &dyn DynMigration

Source§

impl DynMigration for TestMigration

Available on crate feature test only.
Source§

impl<T: Migration + Send + Sync + 'static> DynMigration for T