This commit is contained in:
Chris Tsang 2022-05-09 21:39:41 +08:00
parent 3518acf1b9
commit 1283d9d325

View File

@ -306,7 +306,7 @@ fn update_migrator(migration_name: &str, migration_dir: &str) -> Result<(), Box<
let mut updated_migrator_content = migrator_content.clone(); let mut updated_migrator_content = migrator_content.clone();
// create a backup of the migrator file in case something goes wrong // create a backup of the migrator file in case something goes wrong
let migrator_backup_filepath = migrator_filepath.clone().with_file_name("lib.rs.bkp"); let migrator_backup_filepath = migrator_filepath.clone().with_file_name("lib.rs.bak");
fs::copy(&migrator_filepath, &migrator_backup_filepath)?; fs::copy(&migrator_filepath, &migrator_backup_filepath)?;
let mut migrator_file = fs::File::create(&migrator_filepath)?; let mut migrator_file = fs::File::create(&migrator_filepath)?;