diff --git a/phrase_expansions/management/commands/import_expansions.py b/phrase_expansions/management/commands/import_expansions.py index 002271f161d3d9deee8ed9b7b535757291d17b8a..ebf2c08fbd24a55da7b5dbe4b5a11f7cd3a447c2 100644 --- a/phrase_expansions/management/commands/import_expansions.py +++ b/phrase_expansions/management/commands/import_expansions.py @@ -28,7 +28,7 @@ OPINION_MAP = { } def import_expansions(): - xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'phrase_types_expand_20200926.xml') + xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'phrase_types_expand_20210913.xml') xml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), xml_file) parser = make_parser() diff --git a/reset_db.sh b/reset_db.sh index 7352ed9dddb6d803b68500ae86cb91dc22249e5f..c3b1cc4c74c996a95125806bd359995a6a84345c 100755 --- a/reset_db.sh +++ b/reset_db.sh @@ -1,8 +1,27 @@ #!/bin/bash -dropdb shellvalier -createdb shellvalier -E UTF8 -T template0 -l pl_PL.utf8 -python3 manage.py migrate -python3 manage.py import_plWordnet -python3 manage.py import_tei +sudo su postgres -c "dropdb shellvalier" +sudo su postgres -c "createdb shellvalier -E UTF8 -T template0 -l pl_PL.utf8" +# reset the migrations since we create the DB from scratch +find . -path "*/migrations/*.py" -not -name "__init__.py" -delete +find . -path "*/migrations/*.pyc" -delete + +python manage.py makemigrations +python manage.py migrate + +rm import.log + +time python manage.py start_import +time python manage.py import_expansions +time python manage.py import_plWordnet +time python manage.py import_tei + +head import.log +wc import.log + +#python manage.py check_descriptions +python manage.py generate_semantics_css + +# TODO dev only!!! +python manage.py shell -c "from django.contrib.auth.models import User; User.objects.create_superuser('shell', '', 'valier')" diff --git a/syntax/management/commands/import_tei.py b/syntax/management/commands/import_tei.py index 1d6a8614733537211ef32a4ae8c9ce5f3d27019d..da375866a341fc0d1214c5772b64da8572c7b158 100644 --- a/syntax/management/commands/import_tei.py +++ b/syntax/management/commands/import_tei.py @@ -32,7 +32,7 @@ def import_tei(): logging.basicConfig(filename='import.log', level=logging.DEBUG) #xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20200926_smaller.xml') - xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20200926.xml') + xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20210913_smaller.xml') xml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), xml_file)