Setup database #1
@@ -15,7 +15,7 @@ const DB_READY_STRING: [&str; 1] = ["ready to accept connections"];
|
||||
pub fn get_cli_command() -> CliCommand {
|
||||
CliCommand {
|
||||
command: command(),
|
||||
action: action,
|
||||
action,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ async fn migrate_and_generate_entity(
|
||||
config: &container::Config,
|
||||
output_path: &str,
|
||||
) -> Result<(), ()> {
|
||||
let ready_result = await_database_ready(&config).await;
|
||||
let ready_result = await_database_ready(config).await;
|
||||
if ready_result.is_err() {
|
||||
eprintln!("Database did not become ready in time.");
|
||||
return Err(());
|
||||
@@ -90,7 +90,7 @@ async fn migrate_and_generate_entity(
|
||||
ConfigInfoType::PreExisting(pre_existing_info) => &pre_existing_info.url,
|
||||
};
|
||||
|
||||
let db_type = get_database_type(&config);
|
||||
let db_type = get_database_type(config);
|
||||
match migrate_database(db_url).await {
|
||||
Ok(_) => {
|
||||
println!("Database migrated successfully for {:?}", db_type);
|
||||
@@ -163,7 +163,7 @@ async fn await_database_ready(config: &container::Config) -> Result<(), ()> {
|
||||
"Pre-existing database of type {} assumed to be ready.",
|
||||
pre_existing_info.db_type
|
||||
);
|
||||
return Ok(());
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user