Trait diesel::migration::Migration [−][src]
pub trait Migration { fn version(&self) -> &str; fn run(&self, conn: &SimpleConnection) -> Result<(), RunMigrationsError>; fn revert(&self, conn: &SimpleConnection) -> Result<(), RunMigrationsError>; fn file_path(&self) -> Option<&Path> { ... } }
Represents a migration that interacts with diesel
Required Methods
fn version(&self) -> &str
Get the migration version
fn run(&self, conn: &SimpleConnection) -> Result<(), RunMigrationsError>
Apply this migration
fn revert(&self, conn: &SimpleConnection) -> Result<(), RunMigrationsError>
Revert this migration
Provided Methods
Trait Implementations
impl<'a> Migration for &'a Migration
[src]
impl<'a> Migration for &'a Migration
fn version(&self) -> &str
[src]
fn version(&self) -> &str
Get the migration version
fn run(&self, conn: &SimpleConnection) -> Result<(), RunMigrationsError>
[src]
fn run(&self, conn: &SimpleConnection) -> Result<(), RunMigrationsError>
Apply this migration
fn revert(&self, conn: &SimpleConnection) -> Result<(), RunMigrationsError>
[src]
fn revert(&self, conn: &SimpleConnection) -> Result<(), RunMigrationsError>
Revert this migration
fn file_path(&self) -> Option<&Path>
[src]
fn file_path(&self) -> Option<&Path>
Get the migration file path
Implementations on Foreign Types
impl Migration for Box<Migration>
[src]
impl Migration for Box<Migration>
fn version(&self) -> &str
[src]
fn version(&self) -> &str
fn run(&self, conn: &SimpleConnection) -> Result<(), RunMigrationsError>
[src]
fn run(&self, conn: &SimpleConnection) -> Result<(), RunMigrationsError>
fn revert(&self, conn: &SimpleConnection) -> Result<(), RunMigrationsError>
[src]
fn revert(&self, conn: &SimpleConnection) -> Result<(), RunMigrationsError>
fn file_path(&self) -> Option<&Path>
[src]
fn file_path(&self) -> Option<&Path>
Implementors
impl<'a> Migration for &'a Migration