Struct migrant_lib::migration::FileMigration
[−]
[src]
pub struct FileMigration { pub tag: String, pub up: Option<PathBuf>, pub down: Option<PathBuf>, pub stamp: Option<DateTime<Utc>>, }
Define a migration that uses SQL statements saved in files.
Files defined in this migration must be present at run-time
Fields
tag: String
up: Option<PathBuf>
down: Option<PathBuf>
stamp: Option<DateTime<Utc>>
Methods
impl FileMigration
[src]
fn with_tag(tag: &str) -> Result<Self>
[src]
Create a new FileMigration
with a given tag
Tags may contain [a-z0-9-]
fn up<T: AsRef<Path>>(&mut self, up_file: T) -> Result<&mut Self>
[src]
Define the file to use for running up
migrations
fn down<T: AsRef<Path>>(&mut self, down_file: T) -> Result<&mut Self>
[src]
Define the file to use for running down
migrations
fn boxed(&self) -> Box<Migratable>
[src]
Box this migration up so it can be stored with other migrations
Trait Implementations
impl Clone for FileMigration
[src]
fn clone(&self) -> FileMigration
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for FileMigration
[src]
impl Migratable for FileMigration
[src]
fn apply_up(&self, db_kind: DbKind, config: &Config) -> Result<(), Box<Error>>
[src]
Define functionality that runs for up
migrations
fn apply_down(&self, db_kind: DbKind, config: &Config) -> Result<(), Box<Error>>
[src]
Define functionality that runs for down
migrations
fn tag(&self) -> String
[src]
A unique identifying tag
fn description(&self, direction: &Direction) -> String
[src]
Option migration description. Defaults to Migratable::tag