Skip to content
Snippets Groups Projects
Select Git revision
  • afb782c1460ead90ae3bec65fe89dd8f2ac5e73d
  • master default protected
  • vertical_relations
  • lu_without_semantic_frames
  • hierarchy
  • additional-unification-filters
  • v0.1.1
  • v0.1.0
  • v0.0.9
  • v0.0.8
  • v0.0.7
  • v0.0.6
  • v0.0.5
  • v0.0.4
  • v0.0.3
  • v0.0.2
  • v0.0.1
17 results

reset_db.sh

Blame
  • reset_db.sh 1.29 KiB
    #!/bin/bash
    
    set -e
    
    python manage.py reset_db --noinput
    
    # 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 || true
    
    time python manage.py create_groups_and_permissions
    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')"
    python manage.py shell -c "from django.contrib.auth.models import User; from django.contrib.auth.models import Group; user = User.objects.create_user('Leksykograf', '', 'valier111'); group = Group.objects.get(name='Leksykografowie'); user.groups.add(group); user.save();"
    python manage.py shell -c "from django.contrib.auth.models import User; from django.contrib.auth.models import Group; user = User.objects.create_user('Superleksykograf', '', 'valier111'); group = Group.objects.get(name='Super Leksykografowie'); user.groups.add(group); user.save();"