aboutsummaryrefslogtreecommitdiffstats
path: root/compose/config/db-pg/db-pg.sh
diff options
context:
space:
mode:
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