From ee49a9217cdf40eb5bd6ba8a1b119ba856e34fe7 Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 23 Sep 2022 08:46:49 -0300 Subject: [PATCH] =?UTF-8?q?Trata=20migra=C3=A7=C3=A3o=20como=20primeira=20?= =?UTF-8?q?por=20padr=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/legacy/management/commands/migracao_25_31.py | 3 +-- sapl/legacy/migracao.py | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/sapl/legacy/management/commands/migracao_25_31.py b/sapl/legacy/management/commands/migracao_25_31.py index 4d1cf0147..b7326240d 100644 --- a/sapl/legacy/management/commands/migracao_25_31.py +++ b/sapl/legacy/management/commands/migracao_25_31.py @@ -1,5 +1,4 @@ from django.core.management.base import BaseCommand - from sapl.legacy.migracao import migrar @@ -19,7 +18,7 @@ class Command(BaseCommand): parser.add_argument( "--primeira_migracao", action="store_true", - default=False, + default=True, dest="primeira_migracao", help="Apagar banco antes de migrar", ) diff --git a/sapl/legacy/migracao.py b/sapl/legacy/migracao.py index caa893c0f..48e36f639 100644 --- a/sapl/legacy/migracao.py +++ b/sapl/legacy/migracao.py @@ -1,12 +1,8 @@ -import os import subprocess from getpass import getpass import requests -import yaml from django.core import management -from unipath import Path - from sapl.legacy.migracao_dados import REPO, TAG_MARCO, gravar_marco, info, migrar_dados from sapl.legacy.migracao_documentos import migrar_documentos from sapl.legacy.migracao_usuarios import migrar_usuarios @@ -14,13 +10,14 @@ from sapl.legacy.scripts.exporta_zope.variaveis_comuns import TAG_ZOPE from sapl.legacy.scripts.verifica_diff import verifica_diff from sapl.legacy_migration_settings import DIR_REPO, NOME_BANCO_LEGADO from sapl.materia.models import Proposicao +from unipath import Path def adornar_msg(msg): return "\n{1}\n{0}\n{1}".format(msg, "#" * len(msg)) -def migrar(primeira_migracao=False, apagar_do_legado=False): +def migrar(primeira_migracao=True, apagar_do_legado=False): if TAG_MARCO in REPO.tags: info("A migração já está feita.") return