chore: return new fn for migration manager
This commit is contained in:
parent
285d1778b4
commit
7ae88ce3d3
1 changed files with 9 additions and 3 deletions
|
@ -55,11 +55,17 @@ pub struct MigrationManager {
|
||||||
migrations_table_name: String,
|
migrations_table_name: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl MigrationManager {
|
||||||
|
fn new(migrations_table_name: &str) -> Self {
|
||||||
|
MigrationManager {
|
||||||
|
migrations_table_name: migrations_table_name.to_owned(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<&Config> for MigrationManager {
|
impl From<&Config> for MigrationManager {
|
||||||
fn from(config: &Config) -> Self {
|
fn from(config: &Config) -> Self {
|
||||||
MigrationManager {
|
MigrationManager::new(&config.migrations.table_name())
|
||||||
migrations_table_name: config.migrations.table_name(),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue