From 7c379e999984b812ac469b2fd61dd6b44cb0fb1e Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Sun, 28 Apr 2019 08:43:51 +0200 Subject: [PATCH] =?UTF-8?q?Cria=20command=20para=20tentar=20migra=C3=A7?= =?UTF-8?q?=C3=A3o=20corretiva?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/management/commands/tenta_correcao.py | 8 ++++++++ sapl/legacy/scripts/restaura_da_producao.sh | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 sapl/legacy/management/commands/tenta_correcao.py diff --git a/sapl/legacy/management/commands/tenta_correcao.py b/sapl/legacy/management/commands/tenta_correcao.py new file mode 100644 index 000000000..699f63c43 --- /dev/null +++ b/sapl/legacy/management/commands/tenta_correcao.py @@ -0,0 +1,8 @@ +from django.core.management.base import BaseCommand + +from sapl.legacy.migracao import tenta_correcao + + +class Command(BaseCommand): + def handle(self, *args, **options): + tenta_correcao() diff --git a/sapl/legacy/scripts/restaura_da_producao.sh b/sapl/legacy/scripts/restaura_da_producao.sh index d0c6f8031..f8a97ab25 100755 --- a/sapl/legacy/scripts/restaura_da_producao.sh +++ b/sapl/legacy/scripts/restaura_da_producao.sh @@ -8,5 +8,4 @@ sudo -u postgres psql -c "CREATE DATABASE $1 WITH OWNER = sapl ENCODING = 'UTF8' sudo -u postgres pg_restore -d $1 -U postgres "$HOME/migracao_sapl/dumps_producao/$1.prod" echo "... restaurado" -DATABASE_NAME=$1 ./manage.py shell_plus --settings=sapl.legacy_migration_settings - +# DATABASE_NAME=$1 ./manage.py shell_plus --settings=sapl.legacy_migration_settings