From ef5193ee42744b3648c225c58ff0656a78040524 Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Fri, 11 Oct 2024 14:44:43 +0200 Subject: [PATCH] Add --dry-run and --verbosity options to makemigrations Add --plan option to migrate s --- .github/workflows/backend-migrations-check.yaml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/workflows/backend-migrations-check.yaml b/.github/workflows/backend-migrations-check.yaml index 75064251d..6ed82954e 100644 --- a/.github/workflows/backend-migrations-check.yaml +++ b/.github/workflows/backend-migrations-check.yaml @@ -55,12 +55,7 @@ jobs: working-directory: ${{ env.backend-directory }} run: | export $(grep -v '^#' .env | xargs) - python manage.py makemigrations --check - - name: Check that all migrations were applied - working-directory: ${{ env.backend-directory }} - run: | - export $(grep -v '^#' .env | xargs) - python manage.py migrate --check + python manage.py makemigrations --check --dry-run --verbosity=3 enterprise-migrations-check: runs-on: ubuntu-20.04 @@ -109,11 +104,5 @@ jobs: working-directory: ${{ env.backend-directory }} run: | export $(grep -v '^#' .env | xargs) - poetry run python manage.py makemigrations --check --settings=${{ env.enterprise-backend-settings-module }} + poetry run python manage.py makemigrations --check --dry-run --verbosity=3 --settings=${{ env.enterprise-backend-settings-module }} if [ $? -ne 0 ]; then echo "::error Migrations were not made, please run the makemigrations command." && exit 1; fi - - name: Check that all migrations were applied - working-directory: ${{ env.backend-directory }} - run: | - export $(grep -v '^#' .env | xargs) - poetry run python manage.py migrate --check --settings=${{ env.enterprise-backend-settings-module }} - if [ $? -ne 0 ]; then echo "::error Migrations were not applied, please run the migrate command." && exit 1; fi