Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/health_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ pub async fn configure_database(config: &DatabaseSettings) -> PgPool {
.await
.expect("Failed to create database.");

//In current version of Postgres we need to give the app user ownership of the database to access it.
connection
.execute(format!(r#"ALTER DATABASE "{}" OWNER TO "{}";"#, config.database_name, config.username).as_str())
.await
.expect("Failed to change ownership.");

// Migrate database
let connection_pool = PgPool::connect(&config.connection_string())
.await
Expand Down