Trait migrant_lib::Migratable[][src]

pub trait Migratable: MigratableClone {
    fn tag(&self) -> String;

    fn apply_up(&self, _: DbKind, _: &Config) -> Result<(), Box<dyn Error>> { ... }
fn apply_down(&self, _: DbKind, _: &Config) -> Result<(), Box<dyn Error>> { ... }
fn description(&self, _: &Direction) -> String { ... } }

A type that can be used to define database migrations

Required methods

fn tag(&self) -> String[src]

A unique identifying tag

Loading content...

Provided methods

fn apply_up(&self, _: DbKind, _: &Config) -> Result<(), Box<dyn Error>>[src]

Define functionality that runs for up migrations

fn apply_down(&self, _: DbKind, _: &Config) -> Result<(), Box<dyn Error>>[src]

Define functionality that runs for down migrations

fn description(&self, _: &Direction) -> String[src]

Option migration description. Defaults to Migratable::tag

Loading content...

Implementors

impl Migratable for EmbeddedMigration[src]

impl Migratable for FileMigration[src]

impl<T, U> Migratable for FnMigration<T, U> where
    T: 'static + Clone + Fn(ConnConfig<'_>) -> Result<(), Box<dyn Error>>,
    U: 'static + Clone + Fn(ConnConfig<'_>) -> Result<(), Box<dyn Error>>, 
[src]

Loading content...