fix postgresql output check

This commit is contained in:
Pirate Praveen 2017-12-12 22:36:30 +05:30
parent cfd79d8b71
commit 64ad41b0b5

View file

@ -9,8 +9,9 @@ export DB RAILS_ENV
cd /usr/share/gitlab
# Check if the db is already present
if [ "$(LANG=C runuser -u postgres -- sh -c "psql gitlab_production -c \"\d\"")" = \
"No relations found." ]; then
db_relations="$(LANG=C runuser -u postgres -- sh -c "psql gitlab_production -c \"\d\"")"
if [ "$db_relations" = "No relations found." ] || \
[ "$db_relations" = "Did not find any relations." ]; then
echo "Initializing database..."
test -f ${gitlab_home}/db/schema.rb || \
runuser -u ${gitlab_user} -- sh -c \