mirror of
https://github.com/LukeMathWalker/zero-to-production.git
synced 2025-05-02 14:44:42 +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
|
.await
|
||||||
.expect("Failed to create database.");
|
.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
|
// Migrate database
|
||||||
let connection_pool = PgPool::connect(&config.connection_string())
|
let connection_pool = PgPool::connect(&config.connection_string())
|
||||||
.await
|
.await
|
||||||
|
|
Loading…
Reference in a new issue