Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use LocalStack for Snowflake emulation in CI builds #1

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b52dd3f
fix(snowflake.yml): update snowflake url to use localstack for testin…
Jan 26, 2024
feb8d6d
fix(snowflake.yml): change snowflake connection URL from "snowflake:/…
Jan 26, 2024
90809d8
chore(snowflake.yml): remove unused drop-all step to simplify the wor…
Jan 26, 2024
0d1a6a5
chore(snowflake.yml): remove unnecessary liquibase-github-action step
Jan 26, 2024
9d64e43
fix(snowflake.yml): fix the order of commands in the workflow to ensu…
Jan 26, 2024
710614b
fix(snowflake.yml): update TH_SNOW_URL environment variable to includ…
Jan 26, 2024
3369320
fix(snowflake.yml): fix TH_SNOW_URL value to include http protocol fo…
Jan 26, 2024
6257f6f
fix(snowflake.yml): change localstack wait command to not specify a t…
Jan 29, 2024
56e3a41
chore(snowflake.yml): update python-version to 3.12.1 for compatibili…
Jan 29, 2024
e853a01
chore(snowflake.yml): add LIQUIBASE_PRO_LICENSE_KEY environment varia…
Jan 29, 2024
471fa86
fix(snowflake.yml): add DOCKER_FLAGS environment variable to enable t…
Feb 1, 2024
157070b
Merge branch 'main' into DAT-16713
jandroav Feb 1, 2024
6d12d96
fix(snowflake.yml): update liquibase command to use liquibase/liquiba…
Feb 1, 2024
e8dd282
chore(snowflake.yml): remove unused LIQUIBASE_PRO_LICENSE_KEY environ…
Feb 1, 2024
a93033d
chore(snowflake.yml): remove unnecessary Liquibase update step
Feb 1, 2024
a07773b
chore(snowflake.yml): update liquibase command to use the new environ…
Feb 1, 2024
ea4dad6
fix(snowflake.yml): add verbose flag (-X) to mvn command to enable de…
Feb 1, 2024
48590d9
fix(snowflake.yml): update LIQUIBASE_PRO_LICENSE_KEY environment vari…
Feb 1, 2024
7a6dbf6
refactor(TestUtils.groovy): remove alter table queries for databasech…
Feb 1, 2024
d9412ab
fix(liquibase): update table and column references in expected SQL sc…
Feb 1, 2024
ed74720
update tests
Feb 1, 2024
b596fe3
fix(liquibase): change table and sequence names to use lowercase "pub…
Feb 1, 2024
6265c81
fix(snowflake.yml): remove verbose logging flag from mvn command to r…
Feb 1, 2024
d089c9c
test commit
whummer Feb 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 31 additions & 14 deletions .github/workflows/snowflake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,43 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: liquibase-github-actions/[email protected]
- name: Setup Python
uses: actions/[email protected]
with:
url: "${{secrets.TH_SNOW_URL}}"
username: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.TH_DB_PASSWD}}"
licenseKey: "${{secrets.LICENSE_KEY}}"
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: "${{secrets.TH_DB_ADMIN}}"
password: "${{secrets.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 }}
run: |
pip install localstack awscli-local
docker pull localstack/localstack-pro
localstack extensions install localstack-extension-snowflake
DEBUG=1 DOCKER_FLAGS='-e SF_LOG=trace' localstack start -d
echo "Waiting for LocalStack startup..."
localstack wait
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
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=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=${{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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/main/groovy/liquibase/harness/util/TestUtils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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.*/, "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<changeSet author="as" id="1">
<pro:createPackage encoding="UTF-8"
packageName="Test package">
CREATE TABLE "PUBLIC".test_table_package (test_id INT NOT NULL);
CREATE TABLE "public".test_table_package (test_id INT NOT NULL);
</pro:createPackage>
<rollback>
<dropTable tableName="test_table_package"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<changeSet author="as" id="1">
<pro:createPackageBody encoding="UTF-8"
packageBodyName="Test package">
CREATE TABLE "PUBLIC".test_table_package_body (test_id INT NOT NULL);
CREATE TABLE "public".test_table_package_body (test_id INT NOT NULL);
</pro:createPackageBody>
<rollback>
<dropTable tableName="test_table_package_body"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
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'
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ALTER TABLE LTHDB."PUBLIC".posts ADD CONSTRAINT fk_posts_authors_test FOREIGN KEY (author_id) REFERENCES LTHDB."PUBLIC".authors (id)
ALTER TABLE "public".posts ADD CONSTRAINT fk_posts_authors_test FOREIGN KEY (author_id) REFERENCES "public".authors (id)
Original file line number Diff line number Diff line change
@@ -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)
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)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ALTER TABLE LTHDB."PUBLIC".posts ALTER COLUMN inserted_date SET NOT NULL
ALTER TABLE "public".posts ALTER COLUMN inserted_date SET NOT NULL
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ALTER TABLE LTHDB."PUBLIC".posts ADD CONSTRAINT pk_posts PRIMARY KEY (id)
ALTER TABLE "public".posts ADD CONSTRAINT pk_posts PRIMARY KEY (id)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ALTER TABLE LTHDB."PUBLIC".authors ADD CONSTRAINT test_unique_constraint UNIQUE (email)
ALTER TABLE "public".authors ADD CONSTRAINT test_unique_constraint UNIQUE (email)
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
CREATE SEQUENCE "PUBLIC".test_sequence START WITH 1 INCREMENT BY 1
ALTER SEQUENCE "PUBLIC".test_sequence INCREMENT BY 10
CREATE SEQUENCE "public".test_sequence START WITH 1 INCREMENT BY 1
ALTER SEQUENCE "public".test_sequence INCREMENT BY 10
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CREATE TABLE "PUBLIC".test_table_package (test_id INT NOT NULL)
CREATE TABLE "public".test_table_package (test_id INT NOT NULL)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CREATE TABLE "PUBLIC".test_table_package_body (test_id INT NOT NULL)
CREATE TABLE "public".test_table_package_body (test_id INT NOT NULL)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CREATE SEQUENCE "PUBLIC".test_sequence START WITH 1 INCREMENT BY 5
CREATE SEQUENCE "public".test_sequence START WITH 1 INCREMENT BY 5
Original file line number Diff line number Diff line change
@@ -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))
CREATE TABLE "public".test_table (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL, CONSTRAINT PK_TEST_TABLE PRIMARY KEY (test_id))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CREATE TABLE LTHDB."PUBLIC".createTableDataTypeDoubleIsFloat (floatCol FLOAT)
CREATE TABLE "public".createTableDataTypeDoubleIsFloat (floatCol FLOAT)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CREATE TABLE LTHDB."PUBLIC".createTableDataTypeText (textCol TEXT)
CREATE TABLE "public".createTableDataTypeText (textCol TEXT)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CREATE TABLE LTHDB."PUBLIC".lms_create_table_test (lms_test_id INT, lms_test_timestamp timestamp)
CREATE TABLE "public".lms_create_table_test (lms_test_id INT, lms_test_timestamp timestamp)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CREATE VIEW LTHDB."PUBLIC".test_view AS select id, first_name, last_name, email from authors
CREATE VIEW "public".test_view AS select id, first_name, last_name, email from authors
Original file line number Diff line number Diff line change
@@ -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)
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)
Original file line number Diff line number Diff line change
@@ -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
ALTER TABLE "public".posts ADD varcharColumn VARCHAR(25)
UPDATE "public".posts SET varcharColumn = 'INITIAL_VALUE'
ALTER TABLE "public".posts DROP COLUMN varcharColumn
Original file line number Diff line number Diff line change
@@ -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
CREATE TABLE "public".dropDefaultTest (id INT, stringColumn STRING DEFAULT 'testDefault')
ALTER TABLE "public".dropDefaultTest ALTER COLUMN stringColumn DROP DEFAULT
Original file line number Diff line number Diff line change
@@ -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
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE OR REPLACE FUNCTION test_function()
returns float
as '3.141592654::FLOAT'
DROP FUNCTION "PUBLIC".test_function()
DROP FUNCTION "public".test_function()
Original file line number Diff line number Diff line change
@@ -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
ALTER TABLE "public".posts ALTER COLUMN inserted_date SET NOT NULL
ALTER TABLE "public".posts ALTER COLUMN inserted_date DROP NOT NULL
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ALTER TABLE LTHDB."PUBLIC".posts ADD CONSTRAINT pk_posts PRIMARY KEY (id)
ALTER TABLE LTHDB."PUBLIC".posts DROP PRIMARY KEY
ALTER TABLE "public".posts ADD CONSTRAINT pk_posts PRIMARY KEY (id)
ALTER TABLE "public".posts DROP PRIMARY KEY
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
CREATE SEQUENCE "PUBLIC".test_sequence START WITH 1 INCREMENT BY 1
DROP SEQUENCE "PUBLIC".test_sequence
CREATE SEQUENCE "public".test_sequence START WITH 1 INCREMENT BY 1
DROP SEQUENCE "public".test_sequence
Original file line number Diff line number Diff line change
@@ -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
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
Original file line number Diff line number Diff line change
@@ -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
ALTER TABLE "public".authors ADD CONSTRAINT test_unique_constraint UNIQUE (email)
ALTER TABLE "public".authors DROP CONSTRAINT test_unique_constraint
Original file line number Diff line number Diff line change
@@ -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
CREATE VIEW "public".test_view AS select id, first_name, last_name, email from authors
DROP VIEW "public".test_view
Original file line number Diff line number Diff line change
@@ -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
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
Original file line number Diff line number Diff line change
@@ -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)
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)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/* prepend comment */ CREATE TABLE LTHDB."PUBLIC".test_table (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL) -- append comment
/* prepend comment */ CREATE TABLE "public".test_table (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL) -- append comment
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ALTER TABLE LTHDB."PUBLIC".authors RENAME COLUMN first_name TO first_name_renameColumn_test
ALTER TABLE "public".authors RENAME COLUMN first_name TO first_name_renameColumn_test
Original file line number Diff line number Diff line change
@@ -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
CREATE SEQUENCE "public".test_sequence START WITH 1 INCREMENT BY 1
ALTER SEQUENCE "public".test_sequence RENAME TO test_sequence_rename_test
Original file line number Diff line number Diff line change
@@ -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
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
Original file line number Diff line number Diff line change
@@ -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
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
Original file line number Diff line number Diff line change
@@ -1 +1 @@
COMMENT ON COLUMN LTHDB."PUBLIC".authors.id IS 'A Test Column Remark'
COMMENT ON COLUMN "public".authors.id IS 'A Test Column Remark'
Original file line number Diff line number Diff line change
@@ -1 +1 @@
COMMENT ON TABLE LTHDB."PUBLIC".authors IS 'A Test Remark'
COMMENT ON TABLE "public".authors IS 'A Test Remark'
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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)
Original file line number Diff line number Diff line change
@@ -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;
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;
Original file line number Diff line number Diff line change
@@ -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
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
Original file line number Diff line number Diff line change
@@ -1 +1 @@
INSERT INTO LTHDB."PUBLIC".posts (id, author_id, title, description, content, inserted_date) VALUES ('100', '6', 'value', 'value', 'value', '2006-10-09')
INSERT INTO "public".posts (id, author_id, title, description, content, inserted_date) VALUES ('100', '6', 'value', 'value', 'value', '2006-10-09')
Loading
Loading