Skip to content

Commit

Permalink
Even more startup logs (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzejkop authored May 29, 2024
1 parent 05719a1 commit 02a5a6b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ impl Database {
let connection_string = config.to_connection_string();

if !Postgres::database_exists(&connection_string).await? {
tracing::info!("Creating database");
Postgres::create_database(&connection_string).await?;
}

tracing::info!("Connecting to the database");
let pool = Pool::connect(&connection_string).await?;

tracing::info!("Running migrations");
MIGRATOR.run(&pool).await?;

tracing::info!("Database initialized");
Ok(Self { pool })
}

Expand Down

0 comments on commit 02a5a6b

Please sign in to comment.