Updating healh_check to allow app user access to integration test tables

This commit is contained in:
Philip Fugate 2025-01-23 01:59:17 -08:00 committed by GitHub
parent 2569ee5434
commit 2c6610684c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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