From c3e6708b72c43768d1eaa8fe63fcca7bc35278fe Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Thu, 16 Mar 2023 12:24:03 -0500 Subject: [PATCH] chore: change the way migrations are invoked for actions and dev builds (#5356) --- .github/workflows/build.yml | 2 +- .github/workflows/ci-run-tests.yml | 2 +- dev/deploy-to-container/start.sh | 2 +- dev/diff/prepare.sh | 2 +- docker/scripts/app-init.sh | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93286e5ea6..d7946c7940 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -151,7 +151,7 @@ jobs: run: | echo "Running checks..." ./ietf/manage.py check - ./ietf/manage.py migrate + ./ietf/manage.py migrate --fake-initial echo "Validating migrations..." if ! ( ietf/manage.py makemigrations --dry-run --check --verbosity 3 ) ; then echo "Model changes without migrations found." diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index b7790d0974..567674168c 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -45,7 +45,7 @@ jobs: run: | echo "Running checks..." ./ietf/manage.py check - ./ietf/manage.py migrate + ./ietf/manage.py migrate --fake-initial echo "Validating migrations..." if ! ( ietf/manage.py makemigrations --dry-run --check --verbosity 3 ) ; then echo "Model changes without migrations found." diff --git a/dev/deploy-to-container/start.sh b/dev/deploy-to-container/start.sh index 3091de0d2d..d397e43a68 100644 --- a/dev/deploy-to-container/start.sh +++ b/dev/deploy-to-container/start.sh @@ -27,7 +27,7 @@ echo "Running Datatracker checks..." # Migrate, adjusting to what the current state of the underlying database might be: echo "Running Datatracker migrations..." -/usr/local/bin/python ./ietf/manage.py migrate --settings=settings_local +/usr/local/bin/python ./ietf/manage.py migrate --fake-initial --settings=settings_local echo "Starting Datatracker..." ./ietf/manage.py runserver 0.0.0.0:8000 --settings=settings_local diff --git a/dev/diff/prepare.sh b/dev/diff/prepare.sh index ad281c1831..5fce2b0564 100644 --- a/dev/diff/prepare.sh +++ b/dev/diff/prepare.sh @@ -14,5 +14,5 @@ chmod +x ./docker/scripts/app-create-dirs.sh ./docker/scripts/app-create-dirs.sh ./ietf/manage.py check -./ietf/manage.py migrate +./ietf/manage.py migrate --fake-initial diff --git a/docker/scripts/app-init.sh b/docker/scripts/app-init.sh index 6d06bb4429..bcd1c728d5 100755 --- a/docker/scripts/app-init.sh +++ b/docker/scripts/app-init.sh @@ -103,7 +103,7 @@ echo "Running initial checks..." # Migrate, adjusting to what the current state of the underlying database might be: -/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local +/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --fake-initial --settings=settings_local echo "-----------------------------------------------------------------"