Struct migrant_lib::migration::FileMigration [−][src]
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
impl FileMigration
[src]
pub fn with_tag(tag: &str) -> Self
[src]
Create a new FileMigration
with a given tag
pub fn up<T: AsRef<Path>>(&mut self, up_file: T) -> Result<&mut Self>
[src]
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.
pub fn down<T: AsRef<Path>>(&mut self, down_file: T) -> Result<&mut Self>
[src]
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.
pub fn boxed(&self) -> Box<dyn 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]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for FileMigration
[src]
impl Migratable for FileMigration
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,