From 6c7a418828458e810db1bb90c65509ffc1f793d3 Mon Sep 17 00:00:00 2001 From: MK13 Date: Sun, 5 May 2019 11:58:09 +0200 Subject: [PATCH] Update database setup guide and introduce password for DB connection --- doc/README | 14 ++++++++++---- .../config/application-postgres.properties | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/doc/README b/doc/README index f46af59..b860396 100644 --- a/doc/README +++ b/doc/README @@ -23,8 +23,14 @@ ------------------ First install PostgreSQL. Then create a user for financer: sudo -iu postgres - createuser --interactive - Enter 'financer' as role name and make it superuser. Then create the actual database: + createuser -P -s -e financer + This creates a user named 'financer' and prompts for the creation of a password for this user. The expected default + password is 'financer'. Then create the actual database: createdb financer - Naming both, the user and the database, 'financer' is the expected default. If you want any other names you need - to adjust the database connection settings of the financer application. + Using 'financer' for the name of the user, its password and the database name is the expected default. If you want + any other values you need to adjust the database connection settings of the financer application. + Then you need to grant the created user permission to the created database: + psql + GRANT ALL PRIVILEGES ON DATABASE "financer" to financer; + \q + exit \ No newline at end of file diff --git a/src/main/resources/config/application-postgres.properties b/src/main/resources/config/application-postgres.properties index 7082fd1..1eeea1c 100644 --- a/src/main/resources/config/application-postgres.properties +++ b/src/main/resources/config/application-postgres.properties @@ -2,6 +2,7 @@ spring.flyway.locations=classpath:/database/postgres,classpath:/database/common spring.datasource.url=jdbc:postgresql://localhost/financer spring.datasource.username=financer +spring.datasource.password=financer # See https://github.com/spring-projects/spring-boot/issues/12007 spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true \ No newline at end of file