From 1fd57a96df7f01d7ff166377524708614089613a Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Mon, 19 Sep 2022 15:18:02 -0300 Subject: [PATCH] Adapta script para usar postgres rodando com docker --- sapl/legacy/scripts/recria_um_db_postgres.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sapl/legacy/scripts/recria_um_db_postgres.sh b/sapl/legacy/scripts/recria_um_db_postgres.sh index a98056f13..0122d4b8b 100755 --- a/sapl/legacy/scripts/recria_um_db_postgres.sh +++ b/sapl/legacy/scripts/recria_um_db_postgres.sh @@ -6,10 +6,9 @@ set -e # Exit immediately if a command exits with a non-zero status echo "Database $1" -sudo -u postgres psql -c "drop DATABASE if exists $1" -sudo -u postgres psql -c "CREATE DATABASE $1 WITH OWNER = sapl ENCODING = 'UTF8' TABLESPACE = pg_default LC_COLLATE = 'pt_BR.UTF-8' LC_CTYPE = 'pt_BR.UTF-8' CONNECTION LIMIT = -1 TEMPLATE template0;" +docker exec -it postgres psql -U sapl -c "drop DATABASE if exists $1" +docker exec -it postgres psql -U sapl -c "CREATE DATABASE $1 WITH OWNER = sapl ENCODING = 'UTF8' TABLESPACE = pg_default LC_COLLATE = 'pt_BR.UTF-8' LC_CTYPE = 'pt_BR.UTF-8' CONNECTION LIMIT = -1 TEMPLATE template0;" echo "--- DJANGO MIGRATE ---" | tee -a $LOG DATABASE_NAME=$1 ./manage.py migrate --settings sapl.legacy_migration_settings -