summaryrefslogtreecommitdiffstats
path: root/compose/config/db-pg/db-pg.sh
diff options
context:
space:
mode:
authoradheli.tavares <adheli.tavares@est.tech>2024-08-15 12:39:19 +0100
committerAdheli Tavares <adheli.tavares@est.tech>2024-08-26 08:21:39 +0000
commitd802fd9a6c6aaffa330a30b68f7896ffebaa4fcd (patch)
tree823eb915f6322a38477d971273a0e43713ce0d06 /compose/config/db-pg/db-pg.sh
parent10cf66cdd2cca12dad9f299714e6294ae35752a7 (diff)
Change default database to PostgreSQL
Issue-ID: POLICY-5118 Change-Id: I22ece93aca3cbc5e406e4942ce5255a7b7b60761 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'compose/config/db-pg/db-pg.sh')
-rwxr-xr-xcompose/config/db-pg/db-pg.sh7
1 files changed, 4 insertions, 3 deletions
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