feat: add support for space-separated migration names (#1570)

* feat: add ability to create space separated migration names

* fmt

* Trim whitespace

---------

Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
This commit is contained in:
Abdulqudduus Babalola 2023-05-03 12:12:09 +01:00 committed by GitHub
parent 9b3c81c281
commit e872436547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,6 +147,8 @@ pub fn run_migrate_generate(
} else { } else {
Local::now().format(FMT) Local::now().format(FMT)
}; };
let migration_name = migration_name.trim().replace(' ', "_");
let migration_name = format!("m{formatted_now}_{migration_name}"); let migration_name = format!("m{formatted_now}_{migration_name}");
create_new_migration(&migration_name, migration_dir)?; create_new_migration(&migration_name, migration_dir)?;