diff --git a/.github/workflows/check_translations.yaml b/.github/workflows/check_translations.yaml index 2ce87a8c1d..1849cb63ac 100644 --- a/.github/workflows/check_translations.yaml +++ b/.github/workflows/check_translations.yaml @@ -46,4 +46,6 @@ jobs: run: | python ./.github/scripts/check_source_strings.py --frontend --backend - name: Check Migration Files - run: python3 .github/scripts/check_migration_files.py + run: | + invoke migrate --detect + python3 .github/scripts/check_migration_files.py diff --git a/.github/workflows/qc_checks.yaml b/.github/workflows/qc_checks.yaml index e3fe43fbde..5f33ac649d 100644 --- a/.github/workflows/qc_checks.yaml +++ b/.github/workflows/qc_checks.yaml @@ -405,7 +405,9 @@ jobs: - name: Test Translations run: invoke dev.translate - name: Check Migration Files - run: python3 .github/scripts/check_migration_files.py + run: | + invoke migrate --detect + python3 .github/scripts/check_migration_files.py - name: Coverage Tests run: invoke dev.test --check --coverage --translations - name: Upload raw coverage to artifacts diff --git a/tasks.py b/tasks.py index 388c43c192..2a565b2959 100644 --- a/tasks.py +++ b/tasks.py @@ -1070,10 +1070,13 @@ def listbackups(c): }, ) @state_logger -def migrate(c, detect: bool = True, verbose: bool = False): - """Performs database migrations. +def migrate(c, detect: bool = False, verbose: bool = False): + """Performs database migrations. This is a critical step if the database schema have been altered. - This is a critical step if the database schema have been altered! + Arguments: + c: Command line context. + detect: Whether to detect and create new migrations based on changes to models. Default is False. + verbose: Whether to print verbose output from migration commands. Default is False. """ info('Running InvenTree database migrations...')