pub trait Migration {
fn version(&self) -> &str;
fn run(&self, conn: &dyn SimpleConnection) -> Result<(), RunMigrationsError>;
fn revert(
&self,
conn: &dyn SimpleConnection
) -> Result<(), RunMigrationsError>;
fn file_path(&self) -> Option<&Path> { ... }
}
Expand description
Represents a migration that interacts with diesel
Required methods
fn run(&self, conn: &dyn SimpleConnection) -> Result<(), RunMigrationsError>
fn run(&self, conn: &dyn SimpleConnection) -> Result<(), RunMigrationsError>
Apply this migration
fn revert(&self, conn: &dyn SimpleConnection) -> Result<(), RunMigrationsError>
fn revert(&self, conn: &dyn SimpleConnection) -> Result<(), RunMigrationsError>
Revert this migration
Provided methods
Trait Implementations
sourceimpl<'a> Migration for &'a dyn Migration
impl<'a> Migration for &'a dyn Migration
sourcefn run(&self, conn: &dyn SimpleConnection) -> Result<(), RunMigrationsError>
fn run(&self, conn: &dyn SimpleConnection) -> Result<(), RunMigrationsError>
Apply this migration
sourcefn revert(&self, conn: &dyn SimpleConnection) -> Result<(), RunMigrationsError>
fn revert(&self, conn: &dyn SimpleConnection) -> Result<(), RunMigrationsError>
Revert this migration