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