File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6868 "deployment_health/views.py" : " d19cc3e8fef8519bae2b7fbdc25d17f6ae7df02479aa8890f4b4d250bb07f2e4" ,
6969 "docker-compose.prod.yml" : " 30df3b5bf90a4d88a81a2d577c34a5f7066c4ee02e2ffccdea4ef7c488a19619" ,
7070 "docker-compose.test.yml" : " 86f2ec8a4da1a1d537de58265b0dad9fd73c50173f05659c7171cd9db91de434" ,
71- "install.sh" : " c6b8f8c2994034a0524eeff3e735ca294acd27af839e3cb5565bf415a4107c70 " ,
71+ "install.sh" : " 31d1aae9853b50e85e797f9903130d642e2f8ed502a58d04b972aad3799b5558 " ,
7272 "nextstrain/Dockerfile" : " f1a3426c2ac065ddb0841e21d657f068c9584e47b8193077cd3bd85e15391335" ,
7373 "nextstrain/auspice-config.json" : " 6fc666bf5a0d05293dfdb6cc6b0800637e52c3335bda065b78c036fb6af0d7af" ,
7474 "scripts/container_start.sh" : " 4b1f3796d1915ce97d0769cc13e711aa62c3c7430051ac075be802fc38e8de9a" ,
Original file line number Diff line number Diff line change @@ -429,6 +429,13 @@ run_hook() {
429429 python " ${args[@]} "
430430}
431431
432+ check_for_missing_migrations () {
433+ # Deployment must never invent schema history. Fail when model changes need
434+ # migration files that have not been generated and committed by developers.
435+ python manage.py makemigrations --check --dry-run --noinput \
436+ || die " Model changes detected without committed Django migrations"
437+ }
438+
432439bootstrap_application () {
433440 [[ -f " $INSTALL_PATH /manage.py" ]] || die " manage.py not found; run --stage first"
434441 [[ -x " $INSTALL_PATH /virtualenv/bin/python" ]] || die " virtualenv not found; run --stage first"
@@ -440,6 +447,7 @@ bootstrap_application() {
440447 python manage.py check --deploy
441448 local hook
442449 for hook in " ${SCRIPT_BEFORE[@]} " ; do run_hook " $hook " ; done
450+ check_for_missing_migrations
443451 before_django_migrate " $ACTION " " $MIGRATION_MODULES "
444452 python manage.py migrate --noinput
445453 if [[ " $LOAD_TABLES " == " true" && " $SKIP_TABLES " == " false" ]]; then
You can’t perform that action at this time.
0 commit comments