From d802fd9a6c6aaffa330a30b68f7896ffebaa4fcd Mon Sep 17 00:00:00 2001 From: "adheli.tavares" Date: Thu, 15 Aug 2024 12:39:19 +0100 Subject: Change default database to PostgreSQL Issue-ID: POLICY-5118 Change-Id: I22ece93aca3cbc5e406e4942ce5255a7b7b60761 Signed-off-by: adheli.tavares --- compose/config/db-pg/db-pg.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'compose/config/db-pg/db-pg.sh') diff --git a/compose/config/db-pg/db-pg.sh b/compose/config/db-pg/db-pg.sh index 14816f08..681191f9 100755 --- a/compose/config/db-pg/db-pg.sh +++ b/compose/config/db-pg/db-pg.sh @@ -1,5 +1,5 @@ #!/bin/bash -xv -# Copyright 2022 Nordix Foundation. All rights reserved +# Copyright (C) 2022, 2024 Nordix Foundation. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,10 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -psql -U postgres -d postgres --command "CREATE USER ${MYSQL_USER} WITH PASSWORD '${MYSQL_PASSWORD}';" +psql -U postgres -d postgres --command "CREATE USER ${PGSQL_USER} WITH PASSWORD '${PGSQL_PASSWORD}';" for db in migration pooling policyadmin policyclamp operationshistory clampacm do psql -U postgres -d postgres --command "CREATE DATABASE ${db};" - psql -U postgres -d postgres --command "GRANT ALL PRIVILEGES ON DATABASE ${db} TO ${MYSQL_USER} ;" + psql -U postgres -d postgres --command "ALTER DATABASE ${db} OWNER TO ${PGSQL_USER} ;" + psql -U postgres -d postgres --command "GRANT ALL PRIVILEGES ON DATABASE ${db} TO ${PGSQL_USER} ;" done \ No newline at end of file -- cgit 1.2.3-korg