Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-11-09 23:18:26 +0300
committerStan Hu <stanhu@gmail.com>2017-11-10 09:14:03 +0300
commit8efdf75bcb3621822523803b02bd308792bf84d5 (patch)
treeb32a37e124f7f5ae1b329a30dac1caf8ea4d0a1d /scripts/create_postgres_user.sh
parent304ceb144cca36dbcefcfb508b0dac220f76c9e1 (diff)
Use a non-superuser user to access GitLab to ensure permissions are proper
We have run into permission issues with MySQL triggers in #36633 that would have been caught earlier either if our migration tests or GitLab QA tests had been testing against non-superuser users. This change creates a non-superuser that has access to the GitLab test database and uses that. Closes #39932
Diffstat (limited to 'scripts/create_postgres_user.sh')
-rw-r--r--scripts/create_postgres_user.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/create_postgres_user.sh b/scripts/create_postgres_user.sh
new file mode 100644
index 00000000000..8a744df3226
--- /dev/null
+++ b/scripts/create_postgres_user.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+psql -h postgres -U postgres postgres <<EOF
+DROP DATABASE IF EXISTS gitlabhq_test;
+CREATE DATABASE gitlabhq_test;
+CREATE USER gitlab;
+GRANT ALL PRIVILEGES ON DATABASE gitlabhq_test TO gitlab;
+EOF