diff --git a/.github/workflows/aws-weekly.yml b/.github/workflows/aws-weekly.yml index 468a9f80b..9a940ce5a 100644 --- a/.github/workflows/aws-weekly.yml +++ b/.github/workflows/aws-weekly.yml @@ -85,7 +85,6 @@ jobs: let splitValues = "${{ matrix.database }}".split(":") core.setOutput("databasePlatform", splitValues[0]); core.setOutput("databaseVersion", splitValues[1]); - - name: Get AWS secrets if: ${{ matrix.version == 'aws' && matrix.database == 'mysql'}} uses: aws-actions/aws-secretsmanager-get-secrets@v2 @@ -192,6 +191,51 @@ jobs: secret-ids: | TH_AURORA_POSTGRESQLURL, /testautomation/db_details/aurora_postgresql_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }} + - name: Get AWS secrets + if: ${{ steps.setup.outputs.databasePlatform == 'mysql' && steps.setup.outputs.databaseVersion == 'aws' }} + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + TH_MYSQLURL_8_0, /testautomation/db_details/aws_mysql_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }} + - name: Get AWS secrets + if: ${{ steps.setup.outputs.databasePlatform == 'mysql' && steps.setup.outputs.databaseVersion == 'aurora' }} + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + TH_AURORA_MYSQLURL, /testautomation/db_details/aurora_mysql_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }} + - name: Get AWS secrets + if: ${{ steps.setup.outputs.databasePlatform == 'oracle' }} + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + TH_ORACLEURL_19, /testautomation/db_details/aws_oracle_19_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }} + - name: Get AWS secrets + if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion != 'aurora' }} + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + TH_PGRESURL_12, /testautomation/db_details/aws_postgresql_12_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }} + TH_PGRESURL_13, /testautomation/db_details/aws_postgresql_13_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }} + TH_PGRESURL_14, /testautomation/db_details/aws_postgresql_14_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }} + - name: Get AWS secrets + if: ${{ steps.setup.outputs.databasePlatform == 'mariadb' }} + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + TH_MARIADBURL_10_6, /testautomation/db_details/aws_mariadb_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }} + - name: Get AWS secrets + if: ${{ steps.setup.outputs.databasePlatform == 'mssql' }} + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + TH_MSSQLURL, /testautomation/db_details/aws_mssql_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }} + TH_MSSQLURL_HOST, /testautomation/db_details/aws_mssql_host_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }} + - name: Get AWS secrets + if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion == 'aurora' }} + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + TH_AURORA_POSTGRESQLURL, /testautomation/db_details/aurora_postgresql_jdbc_${{ needs.deploy-ephemeral-cloud-infra.outputs.resources_id }} - uses: liquibase/liquibase-github-action@v7 if: ${{ steps.setup.outputs.databasePlatform == 'oracle' }} with: @@ -259,7 +303,6 @@ jobs: key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - - name: AWS RDS ${{ steps.setup.outputs.databasePlatform }}-${{ steps.setup.outputs.databaseVersion }} Test Run if: ${{ steps.setup.outputs.databasePlatform == 'postgresql' && steps.setup.outputs.databaseVersion != 'aurora' }} env: diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index 4140e97cd..d4916f907 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -8,16 +8,8 @@ on: jobs: - deploy-ephemeral-cloud-infra: - uses: liquibase/build-logic/.github/workflows/ephemeral-cloud-infra.yml@main - secrets: inherit - with: - deploy: true - snowflake_th: true - test: runs-on: ubuntu-latest - needs: [deploy-ephemeral-cloud-infra] permissions: contents: read id-token: write @@ -26,46 +18,76 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + - name: Setup Python + uses: actions/setup-python@v5.0.0 with: - role-to-assume: ${{ secrets.AWS_DEV_GITHUB_OIDC_ROLE_ARN_BUILD_LOGIC }} - aws-region: us-east-1 - - - name: Get LIQUIBASETH secrets - uses: aws-actions/aws-secretsmanager-get-secrets@v2 - with: - secret-ids: | - TH_DB_ADMIN, liquibaseth_usrname - TH_DB_PASSWD, liquibaseth_pwd + python-version: '3.12.1' - - 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: "${{secrets.TH_SNOW_URL}}" + - 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 }} + GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} + continue-on-error: true + run: | + pip install localstack awscli-local + DEBUG=1 DOCKER_FLAGS='-e SF_LOG=trace' IMAGE_NAME=localstack/snowflake localstack start -d + echo "Waiting for LocalStack startup..." + 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 + echo "TH_SNOW_URL=jdbc:snowflake://http://snowflake.localhost.localstack.cloud:4566" >> $GITHUB_ENV + + - name: Update + continue-on-error: true + 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 + continue-on-error: true env: LIQUIBASE_PRO_LICENSE_KEY: ${{ secrets.LICENSE_KEY }} - run: mvn -Dtest=LiquibaseHarnessSuiteTest -DconfigFile=/harness-config-cloud.yml -DdbName=snowflake -DdbUsername=${{env.TH_DB_ADMIN}} -DdbPassword=${{env.TH_DB_PASSWD}} -DdbUrl='${{secrets.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: Update + continue-on-error: true + if: always() + run: curl -s localhost:4566/_localstack/diagnose | gzip -cf > diagnose.json.gz + + - name: Update + continue-on-error: true + if: always() + run: curl -s snowflake.localhost.localstack.cloud:4566/_localstack/diagnose | gzip -cf > diagnose.json.gz + + - name: Get logs from the localstack-main container + if: always() + run: | + docker logs localstack-main > localstack-main.log + + - name: Archive LocalStack logs + if: always() + uses: actions/upload-artifact@v4 + with: + name: localstack-logs + path: localstack-main.log - name: Archive Snowflake Database Test Results uses: actions/upload-artifact@v4 with: name: snowflake-test-results path: build/spock-reports - - destroy-ephemeral-cloud-infra: - if: always() - needs: [ deploy-ephemeral-cloud-infra, test ] - uses: liquibase/build-logic/.github/workflows/ephemeral-cloud-infra.yml@main - secrets: inherit - with: - destroy: true - stack_id: ${{ needs.deploy-ephemeral-cloud-infra.outputs.stack_id }} - snowflake_th: true \ No newline at end of file + + - name: Archive localstack diagnose + uses: actions/upload-artifact@v4 + with: + name: localstack-diagnose + path: diagnose.json.gz diff --git a/src/main/groovy/liquibase/harness/util/TestUtils.groovy b/src/main/groovy/liquibase/harness/util/TestUtils.groovy index af5a6a2a6..7f7bd0a4d 100644 --- a/src/main/groovy/liquibase/harness/util/TestUtils.groovy +++ b/src/main/groovy/liquibase/harness/util/TestUtils.groovy @@ -26,6 +26,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.*/, "") 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/addColumn.sql b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addColumn.sql index 1764a9081..e32c1832b 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addColumn.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/addColumn.sql @@ -3,4 +3,4 @@ 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 +UPDATE LTHDB.PUBLIC.authors SET dateColumn = '2020-09-21' 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 c623a17ff..7d92c7de0 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 LTHDB.PUBLIC.posts ADD CONSTRAINT fk_posts_authors_test FOREIGN KEY (author_id) REFERENCES LTHDB.PUBLIC.authors (id) 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 b174df8c1..50bd6b432 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 +ALTER TABLE LTHDB.PUBLIC.authors ADD CONSTRAINT FK_AUTHORS_AUTHORS_DATA FOREIGN KEY (email) REFERENCES LTHDB.PUBLIC.authors_data (authors_email) 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 2dfc90af0..398c27b67 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 LTHDB.PUBLIC.posts ALTER COLUMN inserted_date SET NOT NULL 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 5bb00459d..8eb32ef15 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 LTHDB.PUBLIC.posts ADD CONSTRAINT pk_posts PRIMARY KEY (id) 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 d45e103e2..535036f99 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 LTHDB.PUBLIC.authors ADD CONSTRAINT test_unique_constraint UNIQUE (email) 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 3dced348a..75bb5277c 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 +ALTER SEQUENCE PUBLIC.test_sequence INCREMENT BY 10 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 df37e81de..32a75b629 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 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 7392b4973..4cfac381a 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 LTHDB.PUBLIC.test_table (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL, CONSTRAINT PK_TEST_TABLE PRIMARY KEY (test_id)) 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 1c5da67be..ced329190 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 LTHDB.PUBLIC.createTableDataTypeDoubleIsFloat (floatCol FLOAT) 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 ec5e033f6..6e9abef28 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 LTHDB.PUBLIC.createTableDataTypeText (textCol TEXT) 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 f67e9c970..41b3de3f8 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 LTHDB.PUBLIC.lms_create_table_test (lms_test_id INT, lms_test_timestamp timestamp) 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 e5da9576e..a3e9ae322 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 LTHDB.PUBLIC.test_view AS select id, first_name, last_name, email from authors 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 d98f970af..86f17f3c5 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 LTHDB.PUBLIC.posts ADD CONSTRAINT fk_posts_authors_test_2 FOREIGN KEY (id) REFERENCES LTHDB.PUBLIC.authors (id) 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 39acb7727..95703638f 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 LTHDB.PUBLIC.posts DROP COLUMN varcharColumn 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 c1e95f88e..eec831b59 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 +ALTER TABLE LTHDB.PUBLIC.dropDefaultTest ALTER COLUMN stringColumn DROP DEFAULT 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 7e1cca6d1..976fda059 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 LTHDB.PUBLIC.posts DROP CONSTRAINT fk_posts_authors_test 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 02a06817d..d67294cac 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() 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 f0205220c..eb06d1ee4 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 LTHDB.PUBLIC.posts ALTER COLUMN inserted_date DROP NOT NULL 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 1137f15fd..b0b580857 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 LTHDB.PUBLIC.posts DROP PRIMARY KEY 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 5b36cc6cf..60449844d 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 +DROP SEQUENCE PUBLIC.test_sequence 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 a258cfc24..898fba6c5 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 +DROP TABLE LTHDB.PUBLIC.test_table 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 c4c63516a..0c7eaea9a 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 LTHDB.PUBLIC.authors DROP CONSTRAINT test_unique_constraint 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 2876ca958..e7b6b1df7 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 +DROP VIEW LTHDB.PUBLIC.test_view 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 a0ebfc8d3..d25ffbb75 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/snowflake/mergeColumns.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/snowflake/mergeColumns.sql @@ -6,4 +6,4 @@ 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 +ALTER TABLE LTHDB.PUBLIC.full_name_table DROP COLUMN last_name 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 8dd250fcc..eed1fbdab 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 +ALTER TABLE LTHDB.PUBLIC.modify_data_type_test ALTER COLUMN intColumn TYPE NUMBER(20) 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 6ddc70af9..9bd02fa4a 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 LTHDB.PUBLIC.test_table (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL) -- append comment 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 ed165d3a8..71f59d8a0 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 LTHDB.PUBLIC.authors RENAME COLUMN first_name TO first_name_renameColumn_test 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 52fe55a39..845c880d1 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 +ALTER SEQUENCE PUBLIC.test_sequence RENAME TO test_sequence_rename_test 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 a7dfe4274..7560f5c58 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 +ALTER TABLE LTHDB.PUBLIC.oldnametable RENAME TO LTHDB.PUBLIC.newnametable 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 6f170178d..1ebc70406 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 +ALTER VIEW LTHDB.PUBLIC.test_view RENAME TO LTHDB.PUBLIC.test_view_new 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 00befa473..0fd67c7e2 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 LTHDB.PUBLIC.authors.id IS 'A Test Column Remark' 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 f0cb24ffc..cf094d733 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 LTHDB.PUBLIC.authors IS 'A Test Remark' 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 6fb7e5069..eb712696c 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 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 LTHDB.PUBLIC.valueSequenceNextTable SET test_id = PUBLIC.test_sequence.nextval; 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 a986d5c9e..ec75fcdcc 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,7 @@ +<<<<<<< HEAD +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 +======= 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 +DELETE FROM LTHDB.PUBLIC.posts WHERE id=100 +>>>>>>> main 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 65a17fc8f..89ed6c8c9 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,5 @@ -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 +<<<<<<< HEAD +INSERT INTO "public".posts (id, author_id, title, description, content, inserted_date) VALUES ('100', '6', 'value', 'value', 'value', '2006-10-09') +======= +INSERT INTO LTHDB.PUBLIC.posts (id, author_id, title, description, content, inserted_date) VALUES ('100', '6', 'value', 'value', 'value', '2006-10-09') +>>>>>>> main 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 ff62e9317..e62d824ec 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,9 @@ +<<<<<<< HEAD +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') +======= 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 LTHDB.PUBLIC.posts (id, author_id, title, description, content, inserted_date) VALUES (8, 3, 'Title3', 'test3@example.com', 'Content3', '2000-01-01') +>>>>>>> main