Struct migrant_lib::migration::FileMigration [−][src]
pub struct FileMigration {
pub tag: String,
pub up: Option<PathBuf>,
pub down: Option<PathBuf>,
// some fields omitted
}
Expand description
Define a migration that uses SQL statements saved in files.
Note: Files defined in this migration must be present at run-time. File paths can be absolute or relative. Relative file paths are relative to the directory from which the program is run.
Note: SQL statements are batch executed as is. If you want your migration
to happen atomically in a transaction you should manually wrap your statements
in a transaction (begin transaction; ... commit;
).
Fields
tag: String
up: Option<PathBuf>
down: Option<PathBuf>
Implementations
Define the file to use for running up
migrations.
Note: Files defined in this migration must be present at run-time. File paths can be absolute or relative. Relative file paths are relative to the directory from which the program is run.
Define the file to use for running down
migrations.
Note: Files defined in this migration must be present at run-time. File paths can be absolute or relative. Relative file paths are relative to the directory from which the program is run.
Box this migration up so it can be stored with other migrations
Trait Implementations
Define functionality that runs for up
migrations
Define functionality that runs for down
migrations
Option migration description. Defaults to Migratable::tag
Auto Trait Implementations
impl RefUnwindSafe for FileMigration
impl Send for FileMigration
impl Sync for FileMigration
impl Unpin for FileMigration
impl UnwindSafe for FileMigration
Blanket Implementations
Mutably borrows from an owned value. Read more