[][src]Trait dbmigrate_lib::Driver

pub trait Driver {
    fn ensure_migration_table_exists(&self);
fn remove_migration_table(&self);
fn get_current_number(&self) -> i32;
fn set_current_number(&self, number: i32);
fn migrate(&self, migration: String, number: i32) -> Result<()>; }

The common trait that all databases need to implement in order for migrations to work

Required methods

fn ensure_migration_table_exists(&self)

A fn that will create a migration table if it doesn't exist Otherwise do nothing

fn remove_migration_table(&self)

A fn that will delete migration table

fn get_current_number(&self) -> i32

Get the current migration number from the database

fn set_current_number(&self, number: i32)

Set the current migration number in the database

fn migrate(&self, migration: String, number: i32) -> Result<()>

Perform the migration content on the database and set the migration number to be the number given

Loading content...

Implementors

Loading content...