From b52dd3f20c72612262a3898539dd7ae12af6c557 Mon Sep 17 00:00:00 2001 From: jandroav Date: Fri, 26 Jan 2024 15:07:12 +0100 Subject: [PATCH 01/23] fix(snowflake.yml): update snowflake url to use localstack for testing purposes feat(snowflake.yml): add setup for Python 3.11.5 and configure LocalStack for testing feat(snowflake.yml): install localstack-extension-snowflake and localstack-pro docker image feat(snowflake.yml): wait for LocalStack startup and set environment variables for testing feat(snowflake.yml): update Maven command to use dynamic dbName and dbUrl for testing --- .github/workflows/snowflake.yml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index 7c74c8ed6..68e470f1c 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -28,12 +28,33 @@ jobs: changeLogFile: "snowflake.sql" username: "${{secrets.TH_DB_ADMIN}}" password: "${{secrets.TH_DB_PASSWD}}" - url: "${{secrets.TH_SNOW_URL}}" + url: "snowflake://snowflake.localhost.localstack.cloud" + + - name: Setup Python + uses: actions/setup-python@v5.0.0 + with: + python-version: '3.11.5' + + - name: Start & Configure LocalStack + env: + LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }} + GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} + run: | + pip install localstack awscli-local + localstack extensions install localstack-extension-snowflake + docker pull localstack/localstack-pro + localstack start -d + echo "Waiting for LocalStack startup..." + localstack wait -t 30 + echo "Startup complete" + echo "TH_DB_ADMIN=test" >> $GITHUB_ENV + echo "TH_DB_PASSWD=test" >> $GITHUB_ENV + echo "TH_DB=snowflake" >> $GITHUB_ENV - name: Snowflake Test Run env: LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }} - run: mvn -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=snowflake -DdbUsername=${{secrets.TH_DB_ADMIN}} -DdbPassword=${{secrets.TH_DB_PASSWD}} -DdbUrl='${{secrets.TH_SNOW_URL}}' -DrollbackStrategy=rollbackByTag test + run: mvn -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=${{secrets.TH_DB_ADMIN}} -DdbUsername=${{secrets.TH_DB_ADMIN}} -DdbPassword=${{secrets.TH_DB_PASSWD}} -DdbUrl='${{secrets.TH_SNOW_URL}}' -DrollbackStrategy=rollbackByTag test - name: Archive Snowflake Database Test Results uses: actions/upload-artifact@v4 From feb8d6d0a4a834f654188d0267957fdbc58b9964 Mon Sep 17 00:00:00 2001 From: jandroav Date: Fri, 26 Jan 2024 15:08:08 +0100 Subject: [PATCH 02/23] fix(snowflake.yml): change snowflake connection URL from "snowflake://snowflake.localhost.localstack.cloud" to "jdbc:snowflake://snowflake.localhost.localstack.cloud" to use the correct JDBC connection protocol --- .github/workflows/snowflake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index 68e470f1c..dbae72581 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -28,7 +28,7 @@ jobs: changeLogFile: "snowflake.sql" username: "${{secrets.TH_DB_ADMIN}}" password: "${{secrets.TH_DB_PASSWD}}" - url: "snowflake://snowflake.localhost.localstack.cloud" + url: "jdbc:snowflake://snowflake.localhost.localstack.cloud" - name: Setup Python uses: actions/setup-python@v5.0.0 From 90809d88a78a9674e9beb8242ca2244bb53da833 Mon Sep 17 00:00:00 2001 From: jandroav Date: Fri, 26 Jan 2024 15:13:55 +0100 Subject: [PATCH 03/23] chore(snowflake.yml): remove unused drop-all step to simplify the workflow feat(snowflake.yml): update liquibase-github-action to version 7 for better compatibility and functionality --- .github/workflows/snowflake.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index dbae72581..70dcb36cd 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -14,13 +14,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - uses: liquibase-github-actions/drop-all@v4.25.1 - with: - url: "${{secrets.TH_SNOW_URL}}" - username: "${{secrets.TH_DB_ADMIN}}" - password: "${{secrets.TH_DB_PASSWD}}" - licenseKey: "${{secrets.LICENSE_KEY}}" - - uses: liquibase/liquibase-github-action@v7 with: operation: "update" From 0d1a6a5aefaba0b9b8f19eeea648ec8deee5d76d Mon Sep 17 00:00:00 2001 From: jandroav Date: Fri, 26 Jan 2024 15:16:22 +0100 Subject: [PATCH 04/23] chore(snowflake.yml): remove unnecessary liquibase-github-action step feat(snowflake.yml): add environment variable TH_SNOW_URL to store the Snowflake database URL feat(snowflake.yml): update liquibase-github-action step to use environment variables for username, password, and URL chore(snowflake.yml): update Snowflake Test Run step to use environment variables for database admin, username, password, and URL --- .github/workflows/snowflake.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index 70dcb36cd..1f36a33ee 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -14,15 +14,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - uses: liquibase/liquibase-github-action@v7 - with: - operation: "update" - classpath: "src/test/resources/init-changelogs/snowflake" - changeLogFile: "snowflake.sql" - username: "${{secrets.TH_DB_ADMIN}}" - password: "${{secrets.TH_DB_PASSWD}}" - url: "jdbc:snowflake://snowflake.localhost.localstack.cloud" - - name: Setup Python uses: actions/setup-python@v5.0.0 with: @@ -43,11 +34,21 @@ jobs: echo "TH_DB_ADMIN=test" >> $GITHUB_ENV echo "TH_DB_PASSWD=test" >> $GITHUB_ENV echo "TH_DB=snowflake" >> $GITHUB_ENV + echo "TH_SNOW_URL=jdbc:snowflake://snowflake.localhost.localstack.cloud" >> $GITHUB_ENV + + - uses: liquibase/liquibase-github-action@v7 + with: + operation: "update" + classpath: "src/test/resources/init-changelogs/snowflake" + changeLogFile: "snowflake.sql" + username: "${{env.TH_DB_ADMIN}}" + password: "${{env.TH_DB_PASSWD}}" + url: "${{env.TH_SNOW_URL}}" - name: Snowflake Test Run env: LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }} - run: mvn -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=${{secrets.TH_DB_ADMIN}} -DdbUsername=${{secrets.TH_DB_ADMIN}} -DdbPassword=${{secrets.TH_DB_PASSWD}} -DdbUrl='${{secrets.TH_SNOW_URL}}' -DrollbackStrategy=rollbackByTag test + run: mvn -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=${{env.TH_DB_ADMIN}} -DdbUsername=${{env.TH_DB_ADMIN}} -DdbPassword=${{env.TH_DB_PASSWD}} -DdbUrl='${{env.TH_SNOW_URL}}' -DrollbackStrategy=rollbackByTag test - name: Archive Snowflake Database Test Results uses: actions/upload-artifact@v4 From 9d64e43527a597a146508340158e823589c37b88 Mon Sep 17 00:00:00 2001 From: jandroav Date: Fri, 26 Jan 2024 15:35:15 +0100 Subject: [PATCH 05/23] fix(snowflake.yml): fix the order of commands in the workflow to ensure that the localstack-extension-snowflake is installed after starting LocalStack feat(snowflake.yml): add environment variables TH_DB_ADMIN, TH_DB_PASSWD, and TH_DB to the GitHub environment to configure the Snowflake database connection --- .github/workflows/snowflake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index 1f36a33ee..58fdee4e7 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -25,12 +25,12 @@ jobs: GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} run: | pip install localstack awscli-local - localstack extensions install localstack-extension-snowflake docker pull localstack/localstack-pro localstack start -d echo "Waiting for LocalStack startup..." localstack wait -t 30 echo "Startup complete" + localstack extensions install localstack-extension-snowflake echo "TH_DB_ADMIN=test" >> $GITHUB_ENV echo "TH_DB_PASSWD=test" >> $GITHUB_ENV echo "TH_DB=snowflake" >> $GITHUB_ENV From 710614badf9660978c19476d6e7c3f8b15fb56cd Mon Sep 17 00:00:00 2001 From: jandroav Date: Fri, 26 Jan 2024 16:12:45 +0100 Subject: [PATCH 06/23] fix(snowflake.yml): update TH_SNOW_URL environment variable to include the correct port number (4566) for the Snowflake database connection --- .github/workflows/snowflake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index 58fdee4e7..54b27bc2d 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -34,7 +34,7 @@ jobs: echo "TH_DB_ADMIN=test" >> $GITHUB_ENV echo "TH_DB_PASSWD=test" >> $GITHUB_ENV echo "TH_DB=snowflake" >> $GITHUB_ENV - echo "TH_SNOW_URL=jdbc:snowflake://snowflake.localhost.localstack.cloud" >> $GITHUB_ENV + echo "TH_SNOW_URL=jdbc:snowflake://snowflake.localhost.localstack.cloud:4566" >> $GITHUB_ENV - uses: liquibase/liquibase-github-action@v7 with: From 3369320cc9e500e78a833ab36165bc954cb3c61a Mon Sep 17 00:00:00 2001 From: jandroav Date: Fri, 26 Jan 2024 16:20:09 +0100 Subject: [PATCH 07/23] fix(snowflake.yml): fix TH_SNOW_URL value to include http protocol for localstack connection The TH_SNOW_URL value in the snowflake.yml file was updated to include the http protocol for the localstack connection. This change was made to ensure that the connection to the localstack instance is established correctly. --- .github/workflows/snowflake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index 54b27bc2d..fbc1093c9 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -34,7 +34,7 @@ jobs: echo "TH_DB_ADMIN=test" >> $GITHUB_ENV echo "TH_DB_PASSWD=test" >> $GITHUB_ENV echo "TH_DB=snowflake" >> $GITHUB_ENV - echo "TH_SNOW_URL=jdbc:snowflake://snowflake.localhost.localstack.cloud:4566" >> $GITHUB_ENV + echo "TH_SNOW_URL=jdbc:snowflake://http://snowflake.localhost.localstack.cloud:4566" >> $GITHUB_ENV - uses: liquibase/liquibase-github-action@v7 with: From 6257f6f0590a70f4d7a1285e9589ca451a474d74 Mon Sep 17 00:00:00 2001 From: jandroav Date: Mon, 29 Jan 2024 08:43:11 +0100 Subject: [PATCH 08/23] fix(snowflake.yml): change localstack wait command to not specify a timeout to avoid potential issues with startup time feat(snowflake.yml): add installation of localstack-extension-snowflake to enable Snowflake support in LocalStack --- .github/workflows/snowflake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index fbc1093c9..943cfbd3e 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -26,11 +26,11 @@ jobs: run: | pip install localstack awscli-local docker pull localstack/localstack-pro + localstack extensions install localstack-extension-snowflake localstack start -d echo "Waiting for LocalStack startup..." - localstack wait -t 30 + localstack wait echo "Startup complete" - localstack extensions install localstack-extension-snowflake echo "TH_DB_ADMIN=test" >> $GITHUB_ENV echo "TH_DB_PASSWD=test" >> $GITHUB_ENV echo "TH_DB=snowflake" >> $GITHUB_ENV From 56e3a41b43d1fbcc7cd63197945c5a45998f8935 Mon Sep 17 00:00:00 2001 From: jandroav Date: Mon, 29 Jan 2024 08:58:33 +0100 Subject: [PATCH 09/23] chore(snowflake.yml): update python-version to 3.12.1 for compatibility with the project chore(snowflake.yml): add DEBUG=1 flag to localstack start command for debugging purposes --- .github/workflows/snowflake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index 943cfbd3e..e855b0834 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5.0.0 with: - python-version: '3.11.5' + python-version: '3.12.1' - name: Start & Configure LocalStack env: @@ -27,7 +27,7 @@ jobs: pip install localstack awscli-local docker pull localstack/localstack-pro localstack extensions install localstack-extension-snowflake - localstack start -d + DEBUG=1 localstack start -d echo "Waiting for LocalStack startup..." localstack wait echo "Startup complete" From e853a0165f5c38b6f7912f09039621c95df90d89 Mon Sep 17 00:00:00 2001 From: jandroav Date: Mon, 29 Jan 2024 09:08:43 +0100 Subject: [PATCH 10/23] chore(snowflake.yml): add LIQUIBASE_PRO_LICENSE_KEY environment variable to the test job to provide the Liquibase Pro license key feat(snowflake.yml): install Liquibase during the test job to enable running Liquibase commands fix(snowflake.yml): update the Status step to use the 'liquibase update' command instead of the liquibase/liquibase-github-action fix(snowflake.yml): remove unnecessary LIQUIBASE_PRO_LICENSE_KEY environment variable from the Snowflake Test Run step --- .github/workflows/snowflake.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index e855b0834..db9c6a256 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -9,6 +9,8 @@ on: jobs: test: runs-on: ubuntu-latest + env: + LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }} steps: - name: Checkout @@ -19,6 +21,14 @@ jobs: with: python-version: '3.12.1' + - name: Install liquibase + run: | + wget -O- https://repo.liquibase.com/liquibase.asc | gpg --dearmor > liquibase-keyring.gpg && \ + cat liquibase-keyring.gpg | sudo tee /usr/share/keyrings/liquibase-keyring.gpg > /dev/null && \ + echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/liquibase-keyring.gpg] https://repo.liquibase.com stable main' | sudo tee /etc/apt/sources.list.d/liquibase.list + sudo apt-get update + sudo apt-get install liquibase + - name: Start & Configure LocalStack env: LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }} @@ -36,18 +46,10 @@ jobs: echo "TH_DB=snowflake" >> $GITHUB_ENV echo "TH_SNOW_URL=jdbc:snowflake://http://snowflake.localhost.localstack.cloud:4566" >> $GITHUB_ENV - - uses: liquibase/liquibase-github-action@v7 - with: - operation: "update" - classpath: "src/test/resources/init-changelogs/snowflake" - changeLogFile: "snowflake.sql" - username: "${{env.TH_DB_ADMIN}}" - password: "${{env.TH_DB_PASSWD}}" - url: "${{env.TH_SNOW_URL}}" + - name: Status + run: liquibase update --url="${{env.TH_SNOW_URL}}" --username="${{env.TH_DB_ADMIN}}" --password="${{env.TH_DB_PASSWD}}" --classpath="src/test/resources/init-changelogs/snowflake" --changeLogFile="snowflake.sql" - name: Snowflake Test Run - env: - LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }} run: mvn -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=${{env.TH_DB_ADMIN}} -DdbUsername=${{env.TH_DB_ADMIN}} -DdbPassword=${{env.TH_DB_PASSWD}} -DdbUrl='${{env.TH_SNOW_URL}}' -DrollbackStrategy=rollbackByTag test - name: Archive Snowflake Database Test Results From 471fa86f4ea092a8b78aefc8fe98e4587eb560ed Mon Sep 17 00:00:00 2001 From: jandroav Date: Thu, 1 Feb 2024 10:50:25 +0100 Subject: [PATCH 11/23] fix(snowflake.yml): add DOCKER_FLAGS environment variable to enable trace logging in LocalStack chore(snowflake.yml): update job name from "Status" to "Update" for clarity --- .github/workflows/snowflake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index db9c6a256..2407bfc49 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -37,7 +37,7 @@ jobs: pip install localstack awscli-local docker pull localstack/localstack-pro localstack extensions install localstack-extension-snowflake - DEBUG=1 localstack start -d + DEBUG=1 DOCKER_FLAGS='-e SF_LOG=trace' localstack start -d echo "Waiting for LocalStack startup..." localstack wait echo "Startup complete" @@ -46,7 +46,7 @@ jobs: echo "TH_DB=snowflake" >> $GITHUB_ENV echo "TH_SNOW_URL=jdbc:snowflake://http://snowflake.localhost.localstack.cloud:4566" >> $GITHUB_ENV - - name: Status + - name: Update run: liquibase update --url="${{env.TH_SNOW_URL}}" --username="${{env.TH_DB_ADMIN}}" --password="${{env.TH_DB_PASSWD}}" --classpath="src/test/resources/init-changelogs/snowflake" --changeLogFile="snowflake.sql" - name: Snowflake Test Run From 6d12d9662894dac0f5e6511591f721b64a8b79f0 Mon Sep 17 00:00:00 2001 From: jandroav Date: Thu, 1 Feb 2024 10:58:44 +0100 Subject: [PATCH 12/23] fix(snowflake.yml): update liquibase command to use liquibase/liquibase-github-action@v7 for better compatibility and maintainability --- .github/workflows/snowflake.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index 2407bfc49..289225cf5 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -46,8 +46,14 @@ jobs: echo "TH_DB=snowflake" >> $GITHUB_ENV echo "TH_SNOW_URL=jdbc:snowflake://http://snowflake.localhost.localstack.cloud:4566" >> $GITHUB_ENV - - name: Update - run: liquibase update --url="${{env.TH_SNOW_URL}}" --username="${{env.TH_DB_ADMIN}}" --password="${{env.TH_DB_PASSWD}}" --classpath="src/test/resources/init-changelogs/snowflake" --changeLogFile="snowflake.sql" + - uses: liquibase/liquibase-github-action@v7 + with: + operation: "update" + classpath: "src/test/resources/init-changelogs/snowflake" + changeLogFile: "snowflake.sql" + username: "${{env.TH_DB_ADMIN}}" + password: "${{env.TH_DB_PASSWD}}" + url: "${{env.TH_SNOW_URL}}" - name: Snowflake Test Run run: mvn -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=${{env.TH_DB_ADMIN}} -DdbUsername=${{env.TH_DB_ADMIN}} -DdbPassword=${{env.TH_DB_PASSWD}} -DdbUrl='${{env.TH_SNOW_URL}}' -DrollbackStrategy=rollbackByTag test From e8dd282465325ef6e8aa0e26821fc0b11ae36a78 Mon Sep 17 00:00:00 2001 From: jandroav Date: Thu, 1 Feb 2024 11:03:14 +0100 Subject: [PATCH 13/23] chore(snowflake.yml): remove unused LIQUIBASE_PRO_LICENSE_KEY environment variable chore(snowflake.yml): update Snowflake Test Run step to use liquibase command instead of maven command for better consistency and simplicity --- .github/workflows/snowflake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index 289225cf5..d3c667ea7 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -9,8 +9,6 @@ on: jobs: test: runs-on: ubuntu-latest - env: - LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }} steps: - name: Checkout @@ -56,7 +54,9 @@ jobs: url: "${{env.TH_SNOW_URL}}" - name: Snowflake Test Run - run: mvn -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=${{env.TH_DB_ADMIN}} -DdbUsername=${{env.TH_DB_ADMIN}} -DdbPassword=${{env.TH_DB_PASSWD}} -DdbUrl='${{env.TH_SNOW_URL}}' -DrollbackStrategy=rollbackByTag test + env: + LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }} + run: liquibase update --url="${{env.TH_SNOW_URL}}" --username="${{env.TH_DB_ADMIN}}" --password="${{env.TH_DB_PASSWD}}" --classpath="src/test/resources/init-changelogs/snowflake" --changeLogFile="snowflake.sql" - name: Archive Snowflake Database Test Results uses: actions/upload-artifact@v4 From a93033d688605fed8f728eeee9651162279374d1 Mon Sep 17 00:00:00 2001 From: jandroav Date: Thu, 1 Feb 2024 11:03:23 +0100 Subject: [PATCH 14/23] chore(snowflake.yml): remove unnecessary Liquibase update step The Liquibase update step was removed as it is no longer needed for the Snowflake workflow. --- .github/workflows/snowflake.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index d3c667ea7..f7e367679 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -44,15 +44,6 @@ jobs: echo "TH_DB=snowflake" >> $GITHUB_ENV echo "TH_SNOW_URL=jdbc:snowflake://http://snowflake.localhost.localstack.cloud:4566" >> $GITHUB_ENV - - uses: liquibase/liquibase-github-action@v7 - with: - operation: "update" - classpath: "src/test/resources/init-changelogs/snowflake" - changeLogFile: "snowflake.sql" - username: "${{env.TH_DB_ADMIN}}" - password: "${{env.TH_DB_PASSWD}}" - url: "${{env.TH_SNOW_URL}}" - - name: Snowflake Test Run env: LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }} From a07773ba98d365406a68d688786592f0a7700a47 Mon Sep 17 00:00:00 2001 From: jandroav Date: Thu, 1 Feb 2024 11:12:57 +0100 Subject: [PATCH 15/23] chore(snowflake.yml): update liquibase command to use the new environment variables for URL, username, and password test(snowflake.yml): update Maven command to include new environment variables for database configuration --- .github/workflows/snowflake.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index f7e367679..e03555e2a 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -44,10 +44,13 @@ jobs: echo "TH_DB=snowflake" >> $GITHUB_ENV echo "TH_SNOW_URL=jdbc:snowflake://http://snowflake.localhost.localstack.cloud:4566" >> $GITHUB_ENV + - name: Update + run: liquibase update --url="${{env.TH_SNOW_URL}}" --username="${{env.TH_DB_ADMIN}}" --password="${{env.TH_DB_PASSWD}}" --classpath="src/test/resources/init-changelogs/snowflake" --changeLogFile="snowflake.sql" + - name: Snowflake Test Run env: LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }} - run: liquibase update --url="${{env.TH_SNOW_URL}}" --username="${{env.TH_DB_ADMIN}}" --password="${{env.TH_DB_PASSWD}}" --classpath="src/test/resources/init-changelogs/snowflake" --changeLogFile="snowflake.sql" + run: mvn -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=${{env.TH_DB_ADMIN}} -DdbUsername=${{env.TH_DB_ADMIN}} -DdbPassword=${{env.TH_DB_PASSWD}} -DdbUrl='${{env.TH_SNOW_URL}}' -DrollbackStrategy=rollbackByTag test - name: Archive Snowflake Database Test Results uses: actions/upload-artifact@v4 From ea4dad62cb82cc4ab72f12933c3f9de7e54f354a Mon Sep 17 00:00:00 2001 From: jandroav Date: Thu, 1 Feb 2024 11:20:29 +0100 Subject: [PATCH 16/23] fix(snowflake.yml): add verbose flag (-X) to mvn command to enable debug logging for troubleshooting test failures --- .github/workflows/snowflake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index e03555e2a..bd71e748a 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -50,7 +50,7 @@ jobs: - name: Snowflake Test Run env: LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }} - run: mvn -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=${{env.TH_DB_ADMIN}} -DdbUsername=${{env.TH_DB_ADMIN}} -DdbPassword=${{env.TH_DB_PASSWD}} -DdbUrl='${{env.TH_SNOW_URL}}' -DrollbackStrategy=rollbackByTag test + run: mvn -X -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=${{env.TH_DB_ADMIN}} -DdbUsername=${{env.TH_DB_ADMIN}} -DdbPassword=${{env.TH_DB_PASSWD}} -DdbUrl='${{env.TH_SNOW_URL}}' -DrollbackStrategy=rollbackByTag test - name: Archive Snowflake Database Test Results uses: actions/upload-artifact@v4 From 48590d9f79226aa9cd435ce5652fbc88c246efef Mon Sep 17 00:00:00 2001 From: jandroav Date: Thu, 1 Feb 2024 11:50:15 +0100 Subject: [PATCH 17/23] fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to match secrets configuration fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment variable name to --- .github/workflows/snowflake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index bd71e748a..5485a6a1b 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -50,7 +50,7 @@ jobs: - name: Snowflake Test Run env: LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }} - run: mvn -X -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=${{env.TH_DB_ADMIN}} -DdbUsername=${{env.TH_DB_ADMIN}} -DdbPassword=${{env.TH_DB_PASSWD}} -DdbUrl='${{env.TH_SNOW_URL}}' -DrollbackStrategy=rollbackByTag test + run: mvn -X -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=${{env.TH_DB}} -DdbUsername=${{env.TH_DB_ADMIN}} -DdbPassword=${{env.TH_DB_PASSWD}} -DdbUrl='${{env.TH_SNOW_URL}}' -DrollbackStrategy=rollbackByTag test - name: Archive Snowflake Database Test Results uses: actions/upload-artifact@v4 From 7a6dbf68a9e976b7d853f47178a6f41fc48152b8 Mon Sep 17 00:00:00 2001 From: jandroav Date: Thu, 1 Feb 2024 14:34:08 +0100 Subject: [PATCH 18/23] refactor(TestUtils.groovy): remove alter table queries for databasechangelog* tables in the script to improve readability and maintainability --- src/main/groovy/liquibase/harness/util/TestUtils.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/groovy/liquibase/harness/util/TestUtils.groovy b/src/main/groovy/liquibase/harness/util/TestUtils.groovy index fd0b2e804..be58e24fa 100644 --- a/src/main/groovy/liquibase/harness/util/TestUtils.groovy +++ b/src/main/groovy/liquibase/harness/util/TestUtils.groovy @@ -27,6 +27,7 @@ class TestUtils { if (script) { script.replaceAll(/(?m)^--.*/, "") //remove comments .replaceAll(/(?m)^CREATE TABLE .*\w*.*DATABASECHANGELOG.*/, "") //remove create table queries for databasechangelog* tables + .replaceAll(/(?m)^ALTER TABLE .*\w*.*DATABASECHANGELOG.*/, "") //remove alter table queries for databasechangelog* tables .replaceAll(/(?m)^CREATE TABLE .*\w*.*databasechangelog.*/, "") .replaceAll(/(?m)^INSERT INTO .*\w*.*DATABASECHANGELOG.*/, "") //remove insert queries for databasechangelog* tables .replaceAll(/(?m)^INSERT INTO .*\w*.*databasechangelog.*/, "") From d9412ab911360697d7eb9abbf8fb73168a910174 Mon Sep 17 00:00:00 2001 From: jandroav Date: Thu, 1 Feb 2024 14:43:51 +0100 Subject: [PATCH 19/23] fix(liquibase): update table and column references in expected SQL scripts for Snowflake The SQL scripts for adding a column and adding a foreign key constraint were updated to use the correct table and column references. The previous references were using a mix of uppercase and lowercase letters, which caused issues in Snowflake. The updated scripts now use consistent lowercase table and column names, enclosed in double quotes to ensure case sensitivity. This change ensures that the SQL scripts will work correctly in Snowflake. --- .../change/expectedSql/snowflake/addColumn.sql | 12 ++++++------ .../change/expectedSql/snowflake/addForeignKey.sql | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addColumn.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addColumn.sql index fd933c02f..a67a8b728 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addColumn.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addColumn.sql @@ -1,6 +1,6 @@ -ALTER TABLE LTHDB."PUBLIC".authors ADD varcharColumn VARCHAR(25) -ALTER TABLE LTHDB."PUBLIC".authors ADD intColumn INT -ALTER TABLE LTHDB."PUBLIC".authors ADD dateColumn date -UPDATE LTHDB."PUBLIC".authors SET varcharColumn = 'INITIAL_VALUE' -UPDATE LTHDB."PUBLIC".authors SET intColumn = 5 -UPDATE LTHDB."PUBLIC".authors SET dateColumn = '2020-09-21' \ No newline at end of file +ALTER TABLE "public".authors ADD varcharColumn VARCHAR(25) +ALTER TABLE "public".authors ADD intColumn INT +ALTER TABLE "public".authors ADD dateColumn date +UPDATE "public".authors SET varcharColumn = 'INITIAL_VALUE' +UPDATE "public".authors SET intColumn = 5 +UPDATE "public".authors SET dateColumn = '2020-09-21' \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addForeignKey.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addForeignKey.sql index b5cb19888..e1a159a97 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addForeignKey.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addForeignKey.sql @@ -1 +1 @@ -ALTER TABLE LTHDB."PUBLIC".posts ADD CONSTRAINT fk_posts_authors_test FOREIGN KEY (author_id) REFERENCES LTHDB."PUBLIC".authors (id) \ No newline at end of file +ALTER TABLE "public".posts ADD CONSTRAINT fk_posts_authors_test FOREIGN KEY (author_id) REFERENCES "public".authors (id) \ No newline at end of file From ed74720dbb495cc25027b1cd45d2e0d416314a44 Mon Sep 17 00:00:00 2001 From: jandroav Date: Thu, 1 Feb 2024 14:55:29 +0100 Subject: [PATCH 20/23] update tests --- .../expectedSql/snowflake/addLookupTable.sql | 8 ++++---- .../snowflake/addNotNullConstraint.sql | 2 +- .../expectedSql/snowflake/addPrimaryKey.sql | 2 +- .../snowflake/addUniqueConstraint.sql | 2 +- .../expectedSql/snowflake/createTable.sql | 2 +- .../createTableDataTypeDoubleIsFloat.sql | 2 +- .../snowflake/createTableDataTypeText.sql | 2 +- .../snowflake/createTableTimestamp.sql | 2 +- .../expectedSql/snowflake/createView.sql | 2 +- .../snowflake/dropAllForeignKeyConstraints.sql | 4 ++-- .../expectedSql/snowflake/dropColumn.sql | 6 +++--- .../expectedSql/snowflake/dropDefaultValue.sql | 4 ++-- .../expectedSql/snowflake/dropForeignKey.sql | 4 ++-- .../snowflake/dropNotNullConstraint.sql | 4 ++-- .../expectedSql/snowflake/dropPrimaryKey.sql | 4 ++-- .../change/expectedSql/snowflake/dropTable.sql | 4 ++-- .../snowflake/dropUniqueConstraint.sql | 4 ++-- .../change/expectedSql/snowflake/dropView.sql | 4 ++-- .../expectedSql/snowflake/mergeColumns.sql | 18 +++++++++--------- .../expectedSql/snowflake/modifyDataType.sql | 4 ++-- .../change/expectedSql/snowflake/modifySql.sql | 2 +- .../expectedSql/snowflake/renameColumn.sql | 2 +- .../expectedSql/snowflake/renameTable.sql | 4 ++-- .../expectedSql/snowflake/renameView.sql | 4 ++-- .../expectedSql/snowflake/setColumnRemarks.sql | 2 +- .../expectedSql/snowflake/setTableRemarks.sql | 2 +- .../change/expectedSql/snowflake/sql.sql | 2 +- .../change/expectedSql/snowflake/sqlFile.sql | 2 +- .../snowflake/valueSequenceNext.sql | 4 ++-- .../data/expectedSql/snowflake/delete.sql | 4 ++-- .../data/expectedSql/snowflake/insert.sql | 2 +- .../data/expectedSql/snowflake/loadData.sql | 6 +++--- 32 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addLookupTable.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addLookupTable.sql index 9c3909d39..26786ae7e 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addLookupTable.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addLookupTable.sql @@ -1,4 +1,4 @@ -CREATE TABLE LTHDB."PUBLIC".authors_data AS SELECT DISTINCT email AS authors_email FROM LTHDB."PUBLIC".authors WHERE email IS NOT NULL -ALTER TABLE LTHDB."PUBLIC".authors_data ALTER COLUMN authors_email SET NOT NULL -ALTER TABLE LTHDB."PUBLIC".authors_data ADD PRIMARY KEY (authors_email) -ALTER TABLE LTHDB."PUBLIC".authors ADD CONSTRAINT FK_AUTHORS_AUTHORS_DATA FOREIGN KEY (email) REFERENCES LTHDB."PUBLIC".authors_data (authors_email) \ No newline at end of file +CREATE TABLE "public".authors_data AS SELECT DISTINCT email AS authors_email FROM "public".authors WHERE email IS NOT NULL +ALTER TABLE "public".authors_data ALTER COLUMN authors_email SET NOT NULL +ALTER TABLE "public".authors_data ADD PRIMARY KEY (authors_email) +ALTER TABLE "public".authors ADD CONSTRAINT FK_AUTHORS_AUTHORS_DATA FOREIGN KEY (email) REFERENCES "public".authors_data (authors_email) \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addNotNullConstraint.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addNotNullConstraint.sql index 4170dfa9c..6ec21de51 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addNotNullConstraint.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addNotNullConstraint.sql @@ -1 +1 @@ -ALTER TABLE LTHDB."PUBLIC".posts ALTER COLUMN inserted_date SET NOT NULL \ No newline at end of file +ALTER TABLE "public".posts ALTER COLUMN inserted_date SET NOT NULL \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addPrimaryKey.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addPrimaryKey.sql index 00d97f84f..59e197c75 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addPrimaryKey.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addPrimaryKey.sql @@ -1 +1 @@ -ALTER TABLE LTHDB."PUBLIC".posts ADD CONSTRAINT pk_posts PRIMARY KEY (id) \ No newline at end of file +ALTER TABLE "public".posts ADD CONSTRAINT pk_posts PRIMARY KEY (id) \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addUniqueConstraint.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addUniqueConstraint.sql index d0d5245e5..3e977a7a3 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addUniqueConstraint.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addUniqueConstraint.sql @@ -1 +1 @@ -ALTER TABLE LTHDB."PUBLIC".authors ADD CONSTRAINT test_unique_constraint UNIQUE (email) \ No newline at end of file +ALTER TABLE "public".authors ADD CONSTRAINT test_unique_constraint UNIQUE (email) \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTable.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTable.sql index eba1fc523..b736ec249 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTable.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTable.sql @@ -1 +1 @@ -CREATE TABLE LTHDB."PUBLIC".test_table (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL, CONSTRAINT PK_TEST_TABLE PRIMARY KEY (test_id)) \ No newline at end of file +CREATE TABLE "public".test_table (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL, CONSTRAINT PK_TEST_TABLE PRIMARY KEY (test_id)) \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTableDataTypeDoubleIsFloat.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTableDataTypeDoubleIsFloat.sql index dce6c7456..2017f3f55 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTableDataTypeDoubleIsFloat.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTableDataTypeDoubleIsFloat.sql @@ -1 +1 @@ -CREATE TABLE LTHDB."PUBLIC".createTableDataTypeDoubleIsFloat (floatCol FLOAT) \ No newline at end of file +CREATE TABLE "public".createTableDataTypeDoubleIsFloat (floatCol FLOAT) \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTableDataTypeText.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTableDataTypeText.sql index a0eedbb5a..4a7e7fa4b 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTableDataTypeText.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTableDataTypeText.sql @@ -1 +1 @@ -CREATE TABLE LTHDB."PUBLIC".createTableDataTypeText (textCol TEXT) \ No newline at end of file +CREATE TABLE "public".createTableDataTypeText (textCol TEXT) \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTableTimestamp.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTableTimestamp.sql index 7c447aaf2..84eb5f77e 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTableTimestamp.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createTableTimestamp.sql @@ -1 +1 @@ -CREATE TABLE LTHDB."PUBLIC".lms_create_table_test (lms_test_id INT, lms_test_timestamp timestamp) \ No newline at end of file +CREATE TABLE "public".lms_create_table_test (lms_test_id INT, lms_test_timestamp timestamp) \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createView.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createView.sql index 7ba780729..d12a02119 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createView.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createView.sql @@ -1 +1 @@ -CREATE VIEW LTHDB."PUBLIC".test_view AS select id, first_name, last_name, email from authors \ No newline at end of file +CREATE VIEW "public".test_view AS select id, first_name, last_name, email from authors \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropAllForeignKeyConstraints.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropAllForeignKeyConstraints.sql index 88c3eb441..16a07d8f1 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropAllForeignKeyConstraints.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropAllForeignKeyConstraints.sql @@ -1,2 +1,2 @@ -ALTER TABLE LTHDB."PUBLIC".posts ADD CONSTRAINT fk_posts_authors_test_1 FOREIGN KEY (author_id) REFERENCES LTHDB."PUBLIC".authors (id) -ALTER TABLE LTHDB."PUBLIC".posts ADD CONSTRAINT fk_posts_authors_test_2 FOREIGN KEY (id) REFERENCES LTHDB."PUBLIC".authors (id) \ No newline at end of file +ALTER TABLE "public".posts ADD CONSTRAINT fk_posts_authors_test_1 FOREIGN KEY (author_id) REFERENCES "public".authors (id) +ALTER TABLE "public".posts ADD CONSTRAINT fk_posts_authors_test_2 FOREIGN KEY (id) REFERENCES "public".authors (id) \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropColumn.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropColumn.sql index f4915814d..38af8dd40 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropColumn.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropColumn.sql @@ -1,3 +1,3 @@ -ALTER TABLE LTHDB."PUBLIC".posts ADD varcharColumn VARCHAR(25) -UPDATE LTHDB."PUBLIC".posts SET varcharColumn = 'INITIAL_VALUE' -ALTER TABLE LTHDB."PUBLIC".posts DROP COLUMN varcharColumn \ No newline at end of file +ALTER TABLE "public".posts ADD varcharColumn VARCHAR(25) +UPDATE "public".posts SET varcharColumn = 'INITIAL_VALUE' +ALTER TABLE "public".posts DROP COLUMN varcharColumn \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropDefaultValue.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropDefaultValue.sql index 783f6563e..8121ec001 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropDefaultValue.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropDefaultValue.sql @@ -1,2 +1,2 @@ -CREATE TABLE LTHDB."PUBLIC".dropDefaultTest (id INT, stringColumn STRING DEFAULT 'testDefault') -ALTER TABLE LTHDB."PUBLIC".dropDefaultTest ALTER COLUMN stringColumn DROP DEFAULT \ No newline at end of file +CREATE TABLE "public".dropDefaultTest (id INT, stringColumn STRING DEFAULT 'testDefault') +ALTER TABLE "public".dropDefaultTest ALTER COLUMN stringColumn DROP DEFAULT \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropForeignKey.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropForeignKey.sql index a127e82e4..d0db461c5 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropForeignKey.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropForeignKey.sql @@ -1,2 +1,2 @@ -ALTER TABLE LTHDB."PUBLIC".posts ADD CONSTRAINT fk_posts_authors_test FOREIGN KEY (author_id) REFERENCES LTHDB."PUBLIC".authors (id) -ALTER TABLE LTHDB."PUBLIC".posts DROP CONSTRAINT fk_posts_authors_test \ No newline at end of file +ALTER TABLE "public".posts ADD CONSTRAINT fk_posts_authors_test FOREIGN KEY (author_id) REFERENCES "public".authors (id) +ALTER TABLE "public".posts DROP CONSTRAINT fk_posts_authors_test \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropNotNullConstraint.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropNotNullConstraint.sql index 1fa728503..b8a887d51 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropNotNullConstraint.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropNotNullConstraint.sql @@ -1,2 +1,2 @@ -ALTER TABLE LTHDB."PUBLIC".posts ALTER COLUMN inserted_date SET NOT NULL -ALTER TABLE LTHDB."PUBLIC".posts ALTER COLUMN inserted_date DROP NOT NULL \ No newline at end of file +ALTER TABLE "public".posts ALTER COLUMN inserted_date SET NOT NULL +ALTER TABLE "public".posts ALTER COLUMN inserted_date DROP NOT NULL \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropPrimaryKey.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropPrimaryKey.sql index 60bbb25e5..1639f9209 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropPrimaryKey.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropPrimaryKey.sql @@ -1,2 +1,2 @@ -ALTER TABLE LTHDB."PUBLIC".posts ADD CONSTRAINT pk_posts PRIMARY KEY (id) -ALTER TABLE LTHDB."PUBLIC".posts DROP PRIMARY KEY \ No newline at end of file +ALTER TABLE "public".posts ADD CONSTRAINT pk_posts PRIMARY KEY (id) +ALTER TABLE "public".posts DROP PRIMARY KEY \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropTable.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropTable.sql index fcbe4e218..0463ba295 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropTable.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropTable.sql @@ -1,2 +1,2 @@ -CREATE TABLE LTHDB."PUBLIC".test_table (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL, CONSTRAINT PK_TEST_TABLE PRIMARY KEY (test_id)) -DROP TABLE LTHDB."PUBLIC".test_table \ No newline at end of file +CREATE TABLE "public".test_table (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL, CONSTRAINT PK_TEST_TABLE PRIMARY KEY (test_id)) +DROP TABLE "public".test_table \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropUniqueConstraint.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropUniqueConstraint.sql index 4f3b4d45c..be43f805a 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropUniqueConstraint.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropUniqueConstraint.sql @@ -1,2 +1,2 @@ -ALTER TABLE LTHDB."PUBLIC".authors ADD CONSTRAINT test_unique_constraint UNIQUE (email) -ALTER TABLE LTHDB."PUBLIC".authors DROP CONSTRAINT test_unique_constraint \ No newline at end of file +ALTER TABLE "public".authors ADD CONSTRAINT test_unique_constraint UNIQUE (email) +ALTER TABLE "public".authors DROP CONSTRAINT test_unique_constraint \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropView.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropView.sql index 022ef614c..513e82a42 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropView.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropView.sql @@ -1,2 +1,2 @@ -CREATE VIEW LTHDB."PUBLIC".test_view AS select id, first_name, last_name, email from authors -DROP VIEW LTHDB."PUBLIC".test_view \ No newline at end of file +CREATE VIEW "public".test_view AS select id, first_name, last_name, email from authors +DROP VIEW "public".test_view \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/mergeColumns.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/mergeColumns.sql index 29df99b2e..1c74780ee 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/mergeColumns.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/mergeColumns.sql @@ -1,9 +1,9 @@ -CREATE TABLE LTHDB."PUBLIC".full_name_table (first_name VARCHAR(50), last_name VARCHAR(50)) -INSERT INTO LTHDB."PUBLIC".full_name_table (first_name) VALUES ('John') -UPDATE LTHDB."PUBLIC".full_name_table SET last_name = 'Doe' WHERE first_name='John' -INSERT INTO LTHDB."PUBLIC".full_name_table (first_name) VALUES ('Jane') -UPDATE LTHDB."PUBLIC".full_name_table SET last_name = 'Doe' WHERE first_name='Jane' -ALTER TABLE LTHDB."PUBLIC".full_name_table ADD full_name VARCHAR(255) -UPDATE LTHDB."PUBLIC".full_name_table SET full_name = first_name || ' ' || last_name -ALTER TABLE LTHDB."PUBLIC".full_name_table DROP COLUMN first_name -ALTER TABLE LTHDB."PUBLIC".full_name_table DROP COLUMN last_name \ No newline at end of file +CREATE TABLE "public".full_name_table (first_name VARCHAR(50), last_name VARCHAR(50)) +INSERT INTO "public".full_name_table (first_name) VALUES ('John') +UPDATE "public".full_name_table SET last_name = 'Doe' WHERE first_name='John' +INSERT INTO "public".full_name_table (first_name) VALUES ('Jane') +UPDATE "public".full_name_table SET last_name = 'Doe' WHERE first_name='Jane' +ALTER TABLE "public".full_name_table ADD full_name VARCHAR(255) +UPDATE "public".full_name_table SET full_name = first_name || ' ' || last_name +ALTER TABLE "public".full_name_table DROP COLUMN first_name +ALTER TABLE "public".full_name_table DROP COLUMN last_name \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/modifyDataType.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/modifyDataType.sql index c07eb0325..87547dc88 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/modifyDataType.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/modifyDataType.sql @@ -1,2 +1,2 @@ -CREATE TABLE LTHDB."PUBLIC".modify_data_type_test (intColumn NUMBER(10), intColumn2 NUMBER(30)) -ALTER TABLE LTHDB."PUBLIC".modify_data_type_test ALTER COLUMN intColumn TYPE NUMBER(20) \ No newline at end of file +CREATE TABLE "public".modify_data_type_test (intColumn NUMBER(10), intColumn2 NUMBER(30)) +ALTER TABLE "public".modify_data_type_test ALTER COLUMN intColumn TYPE NUMBER(20) \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/modifySql.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/modifySql.sql index e34136e02..1ee564759 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/modifySql.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/modifySql.sql @@ -1 +1 @@ -/* prepend comment */ CREATE TABLE LTHDB."PUBLIC".test_table (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL) -- append comment \ No newline at end of file +/* prepend comment */ CREATE TABLE "public".test_table (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL) -- append comment \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameColumn.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameColumn.sql index a16984a9e..6ff9075da 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameColumn.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameColumn.sql @@ -1 +1 @@ -ALTER TABLE LTHDB."PUBLIC".authors RENAME COLUMN first_name TO first_name_renameColumn_test \ No newline at end of file +ALTER TABLE "public".authors RENAME COLUMN first_name TO first_name_renameColumn_test \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameTable.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameTable.sql index 1a8855ab9..d69758584 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameTable.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameTable.sql @@ -1,2 +1,2 @@ -CREATE TABLE LTHDB."PUBLIC".oldnametable (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL, CONSTRAINT PK_OLDNAMETABLE PRIMARY KEY (test_id)) -ALTER TABLE LTHDB."PUBLIC".oldnametable RENAME TO LTHDB."PUBLIC".newnametable \ No newline at end of file +CREATE TABLE "public".oldnametable (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL, CONSTRAINT PK_OLDNAMETABLE PRIMARY KEY (test_id)) +ALTER TABLE "public".oldnametable RENAME TO "public".newnametable \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameView.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameView.sql index 2b6bfaa4a..6f038f4cf 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameView.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameView.sql @@ -1,2 +1,2 @@ -CREATE VIEW LTHDB."PUBLIC".test_view AS select id, first_name, last_name, email from authors -ALTER VIEW LTHDB."PUBLIC".test_view RENAME TO LTHDB."PUBLIC".test_view_new \ No newline at end of file +CREATE VIEW "public".test_view AS select id, first_name, last_name, email from authors +ALTER VIEW "public".test_view RENAME TO "public".test_view_new \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/setColumnRemarks.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/setColumnRemarks.sql index 0aaacc876..2a50bd232 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/setColumnRemarks.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/setColumnRemarks.sql @@ -1 +1 @@ -COMMENT ON COLUMN LTHDB."PUBLIC".authors.id IS 'A Test Column Remark' \ No newline at end of file +COMMENT ON COLUMN "public".authors.id IS 'A Test Column Remark' \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/setTableRemarks.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/setTableRemarks.sql index 9c5f0554c..99703d09e 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/setTableRemarks.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/setTableRemarks.sql @@ -1 +1 @@ -COMMENT ON TABLE LTHDB."PUBLIC".authors IS 'A Test Remark' \ No newline at end of file +COMMENT ON TABLE "public".authors IS 'A Test Remark' \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/sql.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/sql.sql index 434783325..7cfb023d5 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/sql.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/sql.sql @@ -1,4 +1,4 @@ -CREATE TABLE LTHDB."PUBLIC".sqltest (id INT) +CREATE TABLE "public".sqltest (id INT) insert into sqltest (id) values (1) insert into sqltest (id) values (2) insert into sqltest (id) values (3) \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/sqlFile.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/sqlFile.sql index 434783325..7cfb023d5 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/sqlFile.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/sqlFile.sql @@ -1,4 +1,4 @@ -CREATE TABLE LTHDB."PUBLIC".sqltest (id INT) +CREATE TABLE "public".sqltest (id INT) insert into sqltest (id) values (1) insert into sqltest (id) values (2) insert into sqltest (id) values (3) \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/valueSequenceNext.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/valueSequenceNext.sql index 8c58549ab..7ea674d09 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/valueSequenceNext.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/valueSequenceNext.sql @@ -1,3 +1,3 @@ -CREATE TABLE LTHDB."PUBLIC".valueSequenceNextTable (test_id INT, test_column VARCHAR(50)); +CREATE TABLE "public".valueSequenceNextTable (test_id INT, test_column VARCHAR(50)); CREATE SEQUENCE "PUBLIC".test_sequence START WITH 30 INCREMENT BY 2; -UPDATE LTHDB."PUBLIC".valueSequenceNextTable SET test_id = "PUBLIC".test_sequence.nextval; \ No newline at end of file +UPDATE "public".valueSequenceNextTable SET test_id = "PUBLIC".test_sequence.nextval; \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/data/expectedSql/snowflake/delete.sql b/src/main/resources/liquibase/harness/data/expectedSql/snowflake/delete.sql index f91fea4a9..ca61e50d5 100644 --- a/src/main/resources/liquibase/harness/data/expectedSql/snowflake/delete.sql +++ b/src/main/resources/liquibase/harness/data/expectedSql/snowflake/delete.sql @@ -1,2 +1,2 @@ -INSERT INTO LTHDB."PUBLIC".posts (id, author_id, title, description, content, inserted_date) VALUES ('100', '6', 'value', 'value', 'value', '2006-10-09') -DELETE FROM LTHDB."PUBLIC".posts WHERE id=100 \ No newline at end of file +INSERT INTO "public".posts (id, author_id, title, description, content, inserted_date) VALUES ('100', '6', 'value', 'value', 'value', '2006-10-09') +DELETE FROM "public".posts WHERE id=100 \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/data/expectedSql/snowflake/insert.sql b/src/main/resources/liquibase/harness/data/expectedSql/snowflake/insert.sql index 53656c0cd..5fb5d0504 100644 --- a/src/main/resources/liquibase/harness/data/expectedSql/snowflake/insert.sql +++ b/src/main/resources/liquibase/harness/data/expectedSql/snowflake/insert.sql @@ -1 +1 @@ -INSERT INTO LTHDB."PUBLIC".posts (id, author_id, title, description, content, inserted_date) VALUES ('100', '6', 'value', 'value', 'value', '2006-10-09') \ No newline at end of file +INSERT INTO "public".posts (id, author_id, title, description, content, inserted_date) VALUES ('100', '6', 'value', 'value', 'value', '2006-10-09') \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/data/expectedSql/snowflake/loadData.sql b/src/main/resources/liquibase/harness/data/expectedSql/snowflake/loadData.sql index 5ff4f7b50..9872eb19a 100644 --- a/src/main/resources/liquibase/harness/data/expectedSql/snowflake/loadData.sql +++ b/src/main/resources/liquibase/harness/data/expectedSql/snowflake/loadData.sql @@ -1,3 +1,3 @@ -INSERT INTO LTHDB."PUBLIC".posts (id, author_id, title, description, content, inserted_date) VALUES (6, 1, 'Title1', 'test1@example.com', 'Content1', '2000-01-01') -INSERT INTO LTHDB."PUBLIC".posts (id, author_id, title, description, content, inserted_date) VALUES (7, 2, 'Title2', 'test2@example.com', 'Content2', '2000-01-01') -INSERT INTO LTHDB."PUBLIC".posts (id, author_id, title, description, content, inserted_date) VALUES (8, 3, 'Title3', 'test3@example.com', 'Content3', '2000-01-01') \ No newline at end of file +INSERT INTO "public".posts (id, author_id, title, description, content, inserted_date) VALUES (6, 1, 'Title1', 'test1@example.com', 'Content1', '2000-01-01') +INSERT INTO "public".posts (id, author_id, title, description, content, inserted_date) VALUES (7, 2, 'Title2', 'test2@example.com', 'Content2', '2000-01-01') +INSERT INTO "public".posts (id, author_id, title, description, content, inserted_date) VALUES (8, 3, 'Title3', 'test3@example.com', 'Content3', '2000-01-01') \ No newline at end of file From b596fe38006367321ee09aaeb3f8fd14e20506bb Mon Sep 17 00:00:00 2001 From: jandroav Date: Thu, 1 Feb 2024 15:01:21 +0100 Subject: [PATCH 21/23] fix(liquibase): change table and sequence names to use lowercase "public" schema for consistency and improve readability The table and sequence names in the `createPackage.xml`, `createPackageBody.xml`, `alterSequence.sql`, `createPackage.sql`, `createPackageBody.sql`, `createSequence.sql`, `dropFunction.sql`, `dropSequence.sql`, `renameSequence.sql`, and `valueSequenceNext.sql` files were changed to use the lowercase "public" schema instead of the uppercase "PUBLIC" schema. This change was made to improve consistency and readability in the Liquibase change scripts. --- .../harness/change/changelogs/snowflake/createPackage.xml | 2 +- .../harness/change/changelogs/snowflake/createPackageBody.xml | 2 +- .../harness/change/expectedSql/snowflake/alterSequence.sql | 4 ++-- .../harness/change/expectedSql/snowflake/createPackage.sql | 2 +- .../change/expectedSql/snowflake/createPackageBody.sql | 2 +- .../harness/change/expectedSql/snowflake/createSequence.sql | 2 +- .../harness/change/expectedSql/snowflake/dropFunction.sql | 2 +- .../harness/change/expectedSql/snowflake/dropSequence.sql | 4 ++-- .../harness/change/expectedSql/snowflake/renameSequence.sql | 4 ++-- .../change/expectedSql/snowflake/valueSequenceNext.sql | 4 ++-- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/resources/liquibase/harness/change/changelogs/snowflake/createPackage.xml b/src/main/resources/liquibase/harness/change/changelogs/snowflake/createPackage.xml index 86de9d4b4..ab89ac66d 100644 --- a/src/main/resources/liquibase/harness/change/changelogs/snowflake/createPackage.xml +++ b/src/main/resources/liquibase/harness/change/changelogs/snowflake/createPackage.xml @@ -9,7 +9,7 @@ - CREATE TABLE "PUBLIC".test_table_package (test_id INT NOT NULL); + CREATE TABLE "public".test_table_package (test_id INT NOT NULL); diff --git a/src/main/resources/liquibase/harness/change/changelogs/snowflake/createPackageBody.xml b/src/main/resources/liquibase/harness/change/changelogs/snowflake/createPackageBody.xml index 77857af83..983b6bec8 100644 --- a/src/main/resources/liquibase/harness/change/changelogs/snowflake/createPackageBody.xml +++ b/src/main/resources/liquibase/harness/change/changelogs/snowflake/createPackageBody.xml @@ -9,7 +9,7 @@ - CREATE TABLE "PUBLIC".test_table_package_body (test_id INT NOT NULL); + CREATE TABLE "public".test_table_package_body (test_id INT NOT NULL); diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/alterSequence.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/alterSequence.sql index 9db6a5024..4730cf4f3 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/alterSequence.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/alterSequence.sql @@ -1,2 +1,2 @@ -CREATE SEQUENCE "PUBLIC".test_sequence START WITH 1 INCREMENT BY 1 -ALTER SEQUENCE "PUBLIC".test_sequence INCREMENT BY 10 \ No newline at end of file +CREATE SEQUENCE "public".test_sequence START WITH 1 INCREMENT BY 1 +ALTER SEQUENCE "public".test_sequence INCREMENT BY 10 \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createPackage.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createPackage.sql index 092b11fb0..affbbcad1 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createPackage.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createPackage.sql @@ -1 +1 @@ -CREATE TABLE "PUBLIC".test_table_package (test_id INT NOT NULL) \ No newline at end of file +CREATE TABLE "public".test_table_package (test_id INT NOT NULL) \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createPackageBody.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createPackageBody.sql index 0a4bb7b86..bacc51c5e 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createPackageBody.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createPackageBody.sql @@ -1 +1 @@ -CREATE TABLE "PUBLIC".test_table_package_body (test_id INT NOT NULL) \ No newline at end of file +CREATE TABLE "public".test_table_package_body (test_id INT NOT NULL) \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createSequence.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createSequence.sql index 0758c4ca1..46e8cda43 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createSequence.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/createSequence.sql @@ -1 +1 @@ -CREATE SEQUENCE "PUBLIC".test_sequence START WITH 1 INCREMENT BY 5 \ No newline at end of file +CREATE SEQUENCE "public".test_sequence START WITH 1 INCREMENT BY 5 \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropFunction.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropFunction.sql index 14e44a885..e5a4dea0d 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropFunction.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropFunction.sql @@ -1,4 +1,4 @@ CREATE OR REPLACE FUNCTION test_function() returns float as '3.141592654::FLOAT' -DROP FUNCTION "PUBLIC".test_function() \ No newline at end of file +DROP FUNCTION "public".test_function() \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropSequence.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropSequence.sql index 8eb18874e..4564666ec 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropSequence.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/dropSequence.sql @@ -1,2 +1,2 @@ -CREATE SEQUENCE "PUBLIC".test_sequence START WITH 1 INCREMENT BY 1 -DROP SEQUENCE "PUBLIC".test_sequence \ No newline at end of file +CREATE SEQUENCE "public".test_sequence START WITH 1 INCREMENT BY 1 +DROP SEQUENCE "public".test_sequence \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameSequence.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameSequence.sql index 48cd930ea..21c55c5e4 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameSequence.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/renameSequence.sql @@ -1,2 +1,2 @@ -CREATE SEQUENCE "PUBLIC".test_sequence START WITH 1 INCREMENT BY 1 -ALTER SEQUENCE "PUBLIC".test_sequence RENAME TO test_sequence_rename_test \ No newline at end of file +CREATE SEQUENCE "public".test_sequence START WITH 1 INCREMENT BY 1 +ALTER SEQUENCE "public".test_sequence RENAME TO test_sequence_rename_test \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/valueSequenceNext.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/valueSequenceNext.sql index 7ea674d09..956a9326e 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/valueSequenceNext.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/valueSequenceNext.sql @@ -1,3 +1,3 @@ CREATE TABLE "public".valueSequenceNextTable (test_id INT, test_column VARCHAR(50)); -CREATE SEQUENCE "PUBLIC".test_sequence START WITH 30 INCREMENT BY 2; -UPDATE "public".valueSequenceNextTable SET test_id = "PUBLIC".test_sequence.nextval; \ No newline at end of file +CREATE SEQUENCE "public".test_sequence START WITH 30 INCREMENT BY 2; +UPDATE "public".valueSequenceNextTable SET test_id = "public".test_sequence.nextval; \ No newline at end of file From 6265c81dc2c0d01746a35d5b4b1645c1bc094e22 Mon Sep 17 00:00:00 2001 From: jandroav Date: Thu, 1 Feb 2024 15:05:52 +0100 Subject: [PATCH 22/23] fix(snowflake.yml): remove verbose logging flag from mvn command to reduce noise in the workflow logs --- .github/workflows/snowflake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index 5485a6a1b..9ba9e18b2 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -50,7 +50,7 @@ jobs: - name: Snowflake Test Run env: LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }} - run: mvn -X -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=${{env.TH_DB}} -DdbUsername=${{env.TH_DB_ADMIN}} -DdbPassword=${{env.TH_DB_PASSWD}} -DdbUrl='${{env.TH_SNOW_URL}}' -DrollbackStrategy=rollbackByTag test + run: mvn -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=${{env.TH_DB}} -DdbUsername=${{env.TH_DB_ADMIN}} -DdbPassword=${{env.TH_DB_PASSWD}} -DdbUrl='${{env.TH_SNOW_URL}}' -DrollbackStrategy=rollbackByTag test - name: Archive Snowflake Database Test Results uses: actions/upload-artifact@v4 From d089c9c7306c626c066846df4c2fce51c99601c6 Mon Sep 17 00:00:00 2001 From: Waldemar Hummer Date: Tue, 6 Feb 2024 15:49:15 +0100 Subject: [PATCH 23/23] test commit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 894426547..43db4635e 100644 --- a/README.md +++ b/README.md @@ -236,6 +236,7 @@ To change it to another format, like 'sql' for instance, specify `-DinputFormat= ### Adding a change object test + 1) Go to `src/main/resources/liquibase/harness/change/changelogs` and add the xml (or other) changeset for the change type you want to test. - The framework tries to rollback changes after deploying it to DB. If Liquibase knows how to do a rollback for that particular changeset, it will automatically do that.