-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrebuilddatabase.command
More file actions
executable file
·58 lines (52 loc) · 1.39 KB
/
rebuilddatabase.command
File metadata and controls
executable file
·58 lines (52 loc) · 1.39 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# pip_packages=“$(pip freeze)”
# if [[ ${pip_packages} == *django-calendarium* ]]; then
# echo django-calendarium found.
# else
# echo django-calendarium not found, installing....
# pip install django-calendarium
# fi
# if [[ ${pip_packages} == *pytz* ]]; then
# echo pytz found.
# else
# echo pytz not found, installing....
# pip install pytz
# fi
pip install -qr requirements.txt
echo Nuking database..
cd HealthNet/;
sudo rm -rf db.sqlite3 */migrations/ */migrations\ \(1\)/ &&
echo Nuked.
if type python3 >/dev/null 2>&1; then
echo Using command python3....
python3 manage.py makemigrations core appointments messaging sysstats prescriptions transfer testResults calendarium&&
python3 manage.py migrate &&
python3 manage.py loaddata db.json
while getopts “:r” opt; do
case $opt in
r)
echo Running server >&2
python3 manage.py runserver
;;
\?)
echo "Invalid option: -$OPTARG" >&2
;;
esac
done
else
echo Using command python....
python manage.py makemigrations core appointments messaging sysstats prescriptions transfer testResults calendarium&&
python manage.py migrate &&
python manage.py loaddata db.json
while getopts “:r” opt; do
case $opt in
r)
echo Running server >&2
python manage.py runserver
;;
\?)
echo "Invalid option: -$OPTARG" >&2
;;
esac
done
fi