jumpserver/utils/export_init_data.sh

19 lines
311 B
Bash
Raw Normal View History

2016-11-25 14:45:47 +00:00
#!/bin/bash
#
python ../apps/manage.py shell << EOF
2016-11-25 14:45:47 +00:00
from users.models import *
2017-04-04 03:37:52 +00:00
init_model()
2016-11-25 14:45:47 +00:00
from assets.models import *
2017-04-04 03:37:52 +00:00
init_model()
2016-11-25 14:45:47 +00:00
EOF
python ../apps/manage.py dbshell << EOF
2016-11-25 14:45:47 +00:00
delete from auth_permission;
2017-12-07 08:25:50 +00:00
delete from django_content_type;
2016-11-25 14:45:47 +00:00
EOF
python ../apps/manage.py dumpdata > ../apps/fixtures/init.json