diff --git a/docker/social/install.sh b/docker/social/install.sh index 368315129d..df967964ae 100755 --- a/docker/social/install.sh +++ b/docker/social/install.sh @@ -2,8 +2,7 @@ case "${DBMS}" in 'postgres') - PGPASSWORD="${POSTGRES_PASSWORD}" psql -ltq -Upostgres -hdb | \ - cut -d '|' -f1 | grep -Fwq "${SOCIAL_DB}" + test "$(PGPASSWORD="${POSTGRES_PASSWORD}" psql -Upostgres -hdb -tAc "select 1 from pg_database where datname='${SOCIAL_DB}'")" = "1" DB_EXISTS=$? ;; 'mariadb') @@ -28,7 +27,8 @@ if [ ${DB_EXISTS} -ne 0 ]; then chmod g+w -R . chown -R :www-data . - php bin/console doctrine:database:create || exit 1 + php bin/console doctrine:database:drop -f + php bin/console doctrine:database:create php bin/console doctrine:schema:create || exit 1 php bin/console app:populate_initial_values || exit 1