-
Notifications
You must be signed in to change notification settings - Fork 11
/
apply_initial_migrations.sh
executable file
·51 lines (47 loc) · 1.63 KB
/
apply_initial_migrations.sh
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
#!/bin/bash
python manage.py migrate auth &&
python manage.py migrate ledger_api_client &&
# patch admin 0001_initial migration file
if [ $VIRTUAL_ENV ]; then
echo $VIRTUAL_ENV
patch venv/lib/python3.8/site-packages/django/contrib/admin/migrations/0001_initial.py < 0001_initial.py.patch1 &&
status=$?
if [ $status -ne 0 ]; then
echo "Migration patch filed: $status"
exit $status
fi
else
echo "no venv"
patch /usr/local/lib/python3.8/dist-packages/django/contrib/admin/migrations/0001_initial.py < 0001_initial.py.patch1 &&
status=$?
if [ $status -ne 0 ]; then
echo "Migration patch filed: $status"
exit $status
fi
fi
python manage.py migrate admin &&
# repatch admin 0001_initial migration file
if [ $VIRTUAL_ENV ]; then
echo $VIRTUAL_ENV
patch venv/lib/python3.8/site-packages/django/contrib/admin/migrations/0001_initial.py < 0001_initial.py.patch2 &&
status=$?
if [ $status -ne 0 ]; then
echo "Migration patch filed: $status"
exit $status
fi
else
echo "no venv"
patch /usr/local/lib/python3.8/dist-packages/django/contrib/admin/migrations/0001_initial.py < 0001_initial.py.patch2 &&
status=$?
if [ $status -ne 0 ]; then
echo "Migration patch filed: $status"
exit $status
fi
fi
python manage.py migrate django_cron &&
python manage.py migrate sites 0001_initial &&
python manage.py migrate flatpages 0001_initial &&
python manage.py migrate sites 0002_alter_domain_unique &&
python manage.py migrate taggit &&
python manage.py migrate sessions &&
python manage.py migrate