Skip running system checks before migrate, then run them directly after instead

This commit is contained in:
Trenton H 2022-12-14 13:39:07 -08:00
parent bae715cd34
commit 554bba839e

View File

@ -20,7 +20,6 @@ wait_for_postgres() {
exit 1
else
echo "Attempt $attempt_num failed! Trying again in 5 seconds..."
fi
attempt_num=$(("$attempt_num" + 1))
@ -67,10 +66,16 @@ migrations() {
# of the current container starts.
flock 200
echo "Apply database migrations..."
python3 manage.py migrate
python3 manage.py migrate --skip-checks --no-input
) 200>"${DATA_DIR}/migration_lock"
}
django_checks() {
# Explicitly run the Django system checks
echo "Running Django checks"
python3 manage.py check
}
search_index() {
local -r index_version=1
@ -100,6 +105,8 @@ do_work() {
migrations
django_checks
search_index
superuser