mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-18 14:01:04 +00:00
fix: create admin only on debug release
This commit is contained in:
parent
d74a66832f
commit
43c0e1bf17
1 changed files with 9 additions and 3 deletions
|
|
@ -14,17 +14,23 @@ pub struct Migrator;
|
|||
#[async_trait::async_trait]
|
||||
impl MigratorTrait for Migrator {
|
||||
fn migrations() -> Vec<Box<dyn MigrationTrait>> {
|
||||
vec![
|
||||
let mut migrations: Vec<Box<dyn MigrationTrait>> = vec![
|
||||
Box::new(m20221024_111310_create_admin::Migration),
|
||||
Box::new(m20221024_121621_create_candidate::Migration),
|
||||
Box::new(m20221024_124701_create_parent::Migration),
|
||||
Box::new(m20221024_134454_insert_sample_admin::Migration::default()),
|
||||
Box::new(m20221025_154422_create_session::Migration),
|
||||
Box::new(m20221027_194728_session_create_user_fk::Migration),
|
||||
Box::new(m20221112_112212_create_parent_candidate_fk::Migration),
|
||||
Box::new(m20221221_162232_create_admin_session::Migration),
|
||||
Box::new(m20221028_194728_session_create_admin_fk::Migration),
|
||||
];
|
||||
|
||||
]
|
||||
if cfg!(debug_assertions) {
|
||||
migrations.push(Box::new(
|
||||
m20221024_134454_insert_sample_admin::Migration::default(),
|
||||
));
|
||||
}
|
||||
|
||||
migrations
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue