diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2024-08-15 12:39:19 +0100 |
---|---|---|
committer | Adheli Tavares <adheli.tavares@est.tech> | 2024-08-26 08:21:39 +0000 |
commit | d802fd9a6c6aaffa330a30b68f7896ffebaa4fcd (patch) | |
tree | 823eb915f6322a38477d971273a0e43713ce0d06 /compose/config/db-pg | |
parent | 10cf66cdd2cca12dad9f299714e6294ae35752a7 (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')
-rw-r--r-- | compose/config/db-pg/db-pg.conf | 11 | ||||
-rwxr-xr-x | compose/config/db-pg/db-pg.sh | 7 |
2 files changed, 10 insertions, 8 deletions
diff --git a/compose/config/db-pg/db-pg.conf b/compose/config/db-pg/db-pg.conf index d4d58cec..ee26454e 100644 --- a/compose/config/db-pg/db-pg.conf +++ b/compose/config/db-pg/db-pg.conf @@ -1,4 +1,4 @@ -# 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. @@ -11,7 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -MYSQL_ROOT_PASSWORD=secret -MYSQL_USER=policy_user -MYSQL_PASSWORD=policy_user -PGPASSWORD=policy_user
\ No newline at end of file +PGSQL_ROOT_PASSWORD=secret +PGSQL_USER=policy_user +PGSQL_PASSWORD=policy_user +PGPASSWORD=policy_user +POSTGRES_PASSWORD=policy_user 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 |