-
Notifications
You must be signed in to change notification settings - Fork 4
/
dev.bsh
executable file
·45 lines (35 loc) · 1.21 KB
/
dev.bsh
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
#!/usr/bin/env bash
set -u
set -e
source "$(dirname "${BASH_SOURCE[0]}")/vip.bsh"
source "${VIP_VSI_DIR}/linux/ask_question.sh"
: ${SUDO=sudo}
COLOR=${COLOR-$'\e[31m'}
NC=${NC-$'\e[39m'}
if [ "${VIP_OS}" == "Windows" ]; then
stty erase ^H #Necessary for windows ONLY. do not use in linux
fi
echo
ask_question "Would you like to ${COLOR}make migrations${NC} for the database?" make_migrations n
echo
ask_question "Would you like to ${COLOR}migrate (resync)${NC} the database?" resync_database n
if [[ ${make_migrations-0} == 1 ]]; then
read -r -p "What would you like to name the migration? " migration_name
python -m voxel_globe.manage makemigrations -n "${migration_name}"
if [[ $? != 0 ]]; then
echo "There was a problem resyncing the database"
echo "Try again by calling:"
echo " ${VIP_PROJECT_DIR}/warp python -m voxel_globe.manage makemigrations"
exit 1
fi
fi
if [[ ${resync_database-0} == 1 ]]; then
#python -m voxel_globe.manage makemigrations
python -m voxel_globe.manage migrate
if [[ $? != 0 ]]; then
echo "There was a problem resyncing the database"
echo "Try again by calling:"
echo " ${VIP_PROJECT_DIR}/warp python -m voxel_globe.manage migrate"
exit 1
fi
fi