diff --git a/.github/workflows/desiger-check-quartz-update.yml b/.github/workflows/desiger-check-quartz-update.yml index 700a73af8ca..3351a76ffd0 100644 --- a/.github/workflows/desiger-check-quartz-update.yml +++ b/.github/workflows/desiger-check-quartz-update.yml @@ -21,15 +21,12 @@ jobs: with: fetch-depth: 0 - - name: output base branch - id: output-base-branch - run: echo "base-branch=${{ github.head_ref }}" - - name: Check if quartz library is updated id: check-quartz-update run: | - source_branch=${{ github.head_ref }} # Get the base branch - diff=$(git diff --unified=0 $source_branch...backend/packagegroups/NuGet.props | grep + | grep Quartz | grep Version) + git fetch origin ${{ github.base_ref }} && git checkout ${{ github.base_ref }} + git fetch origin ${{ github.head_ref }} && git checkout ${{ github.head_ref }} + diff=$(git diff --unified=0 ${{ github.base_ref }}...${{ github.head_ref }} -- backend/packagegroups/NuGet.props | grep + | grep Quartz | grep Version) if [ -n "$diff" ]; then echo "is-updated=true" >> $GITHUB_OUTPUT else @@ -40,7 +37,7 @@ jobs: id: get-quartz-version if: steps.check-quartz-update.outputs.is-updated == 'true' run: | - version=$(git diff --unified=0 backend/packagegroups/NuGet.props | grep Quartz | grep Version | grep + | sed -n 's/.*Version="\([^"]*\)".*/\1/p') + version=$(git diff --unified=0 ${{ github.base_ref }}...${{ github.head_ref }} -- backend/packagegroups/NuGet.props | grep Quartz | grep Version | grep + | sed -n 's/.*Version="\([^"]*\)".*/\1/p') echo "quartz-version=$version" >> $GITHUB_OUTPUT - name: Verify tables sql is not updated @@ -51,11 +48,24 @@ jobs: jq -r '.assets[] | select(.name | contains("Quartz.NET-${{ steps.get-quartz-version.outputs.quartz-version }}.zip")) | .browser_download_url') mkdir qdwn - curl -L -o qdwn/quartz.zip $download_url && unzip qdwn/quartz.zip && rm qdwn/quartz.zip + curl -L -o qdwn/quartz.zip $download_url && unzip qdwn/quartz.zip -d qdwn && rm qdwn/quartz.zip - diff=$(diff -u backend/src/Designer/Migrations/Quartz/tables_postgres.sql qdwn/database/tables/tables_postgres.sql) + echo "before diff command" + diff_output=$(diff -u backend/src/Designer/Migrations/SqlScripts/QuartzTables/tables_postgres.sql qdwn/database/tables/tables_postgres.sql || true) - if [ -n "$diff" ]; then + echo "outputing diff" + echo $diff_output + echo "finished outputing diff" + + echo "repo file: " + cat backend/src/Designer/Migrations/SqlScripts/QuartzTables/tables_postgres.sql + echo "end repo file" + + echo "quartz file: " + cat qdwn/database/tables/tables_postgres.sql + echo "end quartz file" + + if [ -n "$diff_output" ]; then exit 1; else echo "Tables file is up to date" diff --git a/backend/src/Designer/Migrations/SqlScripts/QuartzTables/tables_postgres.sql b/backend/src/Designer/Migrations/SqlScripts/QuartzTables/tables_postgres.sql index ff1e215d145..fedf2e0448a 100644 --- a/backend/src/Designer/Migrations/SqlScripts/QuartzTables/tables_postgres.sql +++ b/backend/src/Designer/Migrations/SqlScripts/QuartzTables/tables_postgres.sql @@ -1,4 +1,3 @@ -set client_min_messages = WARNING; DROP TABLE IF EXISTS qrtz_fired_triggers; DROP TABLE IF EXISTS qrtz_paused_trigger_grps; DROP TABLE IF EXISTS qrtz_scheduler_state; @@ -10,7 +9,7 @@ DROP TABLE IF EXISTS qrtz_blob_triggers; DROP TABLE IF EXISTS qrtz_triggers; DROP TABLE IF EXISTS qrtz_job_details; DROP TABLE IF EXISTS qrtz_calendars; -set client_min_messages = NOTICE; + CREATE TABLE qrtz_job_details (