Trait dbmigrate_lib::Driver
source · pub trait Driver {
fn ensure_migration_table_exists(&mut self);
fn remove_migration_table(&mut self);
fn get_current_number(&mut self) -> i32;
fn set_current_number(&mut self, number: i32);
fn migrate(&mut self, migration: String, number: i32) -> Result<()>;
}
Expand description
The common trait that all databases need to implement in order for migrations to work
Required Methods§
sourcefn ensure_migration_table_exists(&mut self)
fn ensure_migration_table_exists(&mut self)
A fn that will create a migration table if it doesn’t exist Otherwise do nothing
sourcefn remove_migration_table(&mut self)
fn remove_migration_table(&mut self)
A fn that will delete migration table
sourcefn get_current_number(&mut self) -> i32
fn get_current_number(&mut self) -> i32
Get the current migration number from the database
sourcefn set_current_number(&mut self, number: i32)
fn set_current_number(&mut self, number: i32)
Set the current migration number in the database