mirror of
https://github.com/LukeMathWalker/zero-to-production.git
synced 2025-03-13 22:52:40 +00:00
Updating healh_check to allow app user access to integration test tables
This commit is contained in:
parent
2569ee5434
commit
2c6610684c
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue