Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
SocialGouv
docker
Commits
665b0657
Commit
665b0657
authored
Jan 10, 2022
by
Jo
Browse files
fix(pg-create): decouple create and grant
parent
eb2cc26c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
azure-db/bin/create-db-user
azure-db/bin/create-db-user
+5
-1
No files found.
azure-db/bin/create-db-user
View file @
665b0657
#!/bin/bash
set
+x
set
-
e
set
+
e
#
# create a new user and DB on a remote Azure Postgres server
...
...
@@ -44,6 +44,10 @@ echo "creating user ${NEW_USER_BASE} on ${PGHOST}"
psql
-abe
"
$PG_URL_ADMIN
"
-c
"
SET timezone TO 'Europe/Paris';
CREATE USER
\"
$NEW_USER_BASE
\"
WITH PASSWORD '
$NEW_PASSWORD
';
"
echo
"grant user
${
NEW_USER_BASE
}
on
${
PGHOST
}
"
psql
-abe
"
$PG_URL_ADMIN
"
-c
"
GRANT
\"
$NEW_USER_BASE
\"
to
\"
${
PGUSER
%%@*
}
\"
;
GRANT ALL PRIVILEGES ON DATABASE
\"
$NEW_DB_NAME
\"
TO
\"
$NEW_USER_BASE
\"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment