We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 305bcd2 commit 58c9c68Copy full SHA for 58c9c68
bin/init.sh
@@ -1,15 +1,16 @@
1
#!/usr/bin/env bash
2
set -eux
3
4
-# construct the path to the database file from environment or default
5
-
6
-DB_DIR="${DJANGO_DB_DIR:-.}"
7
-DB_FILE="${DB_DIR}/django.db"
8
9
# remove existing (old) database file
10
-# -f forces the delete (and avoids an error when the file doesn't exist)
11
12
-rm -f "${DB_FILE}"
+if [[ ${DJANGO_DB_RESET:-true} = true ]]; then
+ # construct the path to the database file from environment or default
+ DB_DIR="${DJANGO_DB_DIR:-.}"
+ DB_FILE="${DB_DIR}/django.db"
+
+ # -f forces the delete (and avoids an error when the file doesn't exist)
+ rm -f "${DB_FILE}"
13
+fi
14
15
# run database migrations
16
0 commit comments