pub struct MigrationConfig {
pub path: PathBuf,
pub prefix_style: MigrationPrefixStyle,
pub checksums: bool,
pub statement_breakpoints: bool,
}Expand description
Configuration for migration operations
Fields§
§path: PathBufPath to the migrations folder
prefix_style: MigrationPrefixStyleStyle of migration file prefixes
checksums: boolWhether the history file should store and verify checksums of the migration files so that they may not be changed.
statement_breakpoints: boolWhether to add statement breakpoint comments to generated SQL migration files. These comments mark boundaries where SQL statements should be split for execution. This is needed because different databases have different batching capabilities: some (like PostgreSQL) can execute multiple statements in one batch, while others require each statement to be executed separately.
Implementations§
Source§impl MigrationConfig
impl MigrationConfig
Sourcepub fn prefix_style(self, style: MigrationPrefixStyle) -> Self
pub fn prefix_style(self, style: MigrationPrefixStyle) -> Self
Set the migration prefix style
Sourcepub fn get_migrations_dir(&self) -> PathBuf
pub fn get_migrations_dir(&self) -> PathBuf
Returns the directory of the migration files derived from path.
Sourcepub fn get_snapshots_dir(&self) -> PathBuf
pub fn get_snapshots_dir(&self) -> PathBuf
Returns the directory of the snapshot files derived from path.
Sourcepub fn get_history_file_path(&self) -> PathBuf
pub fn get_history_file_path(&self) -> PathBuf
Get the path to the history file
Trait Implementations§
Source§impl Clone for MigrationConfig
impl Clone for MigrationConfig
Source§fn clone(&self) -> MigrationConfig
fn clone(&self) -> MigrationConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more