-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreset_mysql_db.sh
More file actions
executable file
·32 lines (32 loc) · 1.31 KB
/
reset_mysql_db.sh
File metadata and controls
executable file
·32 lines (32 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
mysql -utree -ptree tree <<EOF
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS app_tree_elementtype_attributes;
DROP TABLE IF EXISTS app_tree_elementtype_required_attr;
DROP TABLE IF EXISTS app_tree_doctype;
DROP TABLE IF EXISTS app_tree_attributetype;
DROP TABLE IF EXISTS app_tree_text;
DROP TABLE IF EXISTS app_tree_attribute;
DROP TABLE IF EXISTS app_tree_elementtype;
DROP TABLE IF EXISTS app_tree_element_texts;
DROP TABLE IF EXISTS app_tree_element_attributes;
DROP TABLE IF EXISTS app_tree_element;
DROP TABLE IF EXISTS app_tree_dataset;
DROP TABLE IF EXISTS app_tree_diff;
DROP TABLE IF EXISTS app_tree_treenode;
SET FOREIGN_KEY_CHECKS = 1;
EOF
./venv/bin/python project/manage.py syncdb
echo 'Loading ipc_scheme 20150101...'
./venv/bin/python project/manage.py load_xml ipc_scheme 20150101 en --xml
echo
echo 'Loading ipc_scheme 20140101...'
./venv/bin/python project/manage.py load_xml ipc_scheme 20140101 en --xml --no_types
echo
echo 'Loading nice_classes 20150101...'
./venv/bin/python project/manage.py load_xml nice_classes 20150101 en 20141215 --xml
echo
echo 'Loading nice_indications 20150101...'
./venv/bin/python project/manage.py load_xml nice_indications 20150101 en 20141219 --xml
echo
echo 'Diffing ipc_scheme 20140101 and 20150101...'
./venv/bin/python project/manage.py diff_trees ipc_scheme 20140101 20150101