update asset

This commit is contained in:
ibuler
2016-11-25 22:45:47 +08:00
parent 6e843533cb
commit c1c9c7b68a
15 changed files with 172 additions and 154 deletions

6
utils/clean_migrations.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
#
for app in users assets perms audits teminal ops;do
rm -f $app/migrations/000*
done

4
utils/init_db.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
#
python ../apps/manage.py loaddata init

10
utils/make_fake_json.sh Normal file
View File

@@ -0,0 +1,10 @@
#!/bin/bash
#
python ../apps/manage.py dbshell << EOF
delete from django_content_type;
delete from auth_permission;
EOF
python ../apps/manage.py dumpdata > ../apps/fixtures/init.json

18
utils/make_init_json.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
#
python ../apps/manage.py shell << EOF
from users.models import *
init_all_models()
from assets.models import *
init_all_models()
EOF
python ../apps/manage.py dbshell << EOF
delete from django_content_type;
delete from auth_permission;
EOF
python ../apps/manage.py dumpdata > ../apps/fixtures/init.json

6
utils/make_migrations.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
#
python ../apps/manage.py makemigrations
python ../apps/manage.py migrate