Skip to content

Commit

Permalink
Merge pull request #594 from liquibase/DAT-14667
Browse files Browse the repository at this point in the history
DAT-14667. added oracle 23.0.0 to the CI/CD
  • Loading branch information
PavloTytarchuk committed Aug 4, 2023
2 parents 3f5e2eb + d69ab62 commit d18ee27
Show file tree
Hide file tree
Showing 74 changed files with 267 additions and 12 deletions.
22 changes: 13 additions & 9 deletions .github/workflows/OracleRunParallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,22 @@ on:
- cron: '0 8 * * *' # Execute every day at 8am
workflow_dispatch:


jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
plan: [ 18.4.0, 19.3.0, 21.3.0 ]
plan: [ 18.4.0, 19.3.0, 21.3.0, 23.2.0 ]

steps:
- uses: actions/checkout@v3
- run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/setup-java@v3
with:
Expand All @@ -35,12 +34,17 @@ jobs:
run: docker login "${{ secrets.ARTIFACTORY_URL }}" -u "${{ secrets.ARTIFACTORY_USER }}" -p "${{ secrets.ARTIFACTORY_TOKEN }}"

- name: Build Oracle Artifactory test infra
if: ${{ matrix.plan == '19.3.0' }}
working-directory: src/test/resources/docker/oracle-artifactory
run: docker-compose up -d

- name: Build Oracle XE test infra
if: ${{ matrix.plan != '19.3.0' }}
working-directory: src/test/resources/docker/oracle-xe
run: docker-compose up -d
run: |
# Constructing service name from version
SERVICE_NAME="oracle-xe-${{ matrix.plan }}"
docker-compose up -d $SERVICE_NAME
# Adding sleep to avoid ORA-12514 error when database & listeners are still in the middle of startup
- name: Sleep for 180 seconds
Expand All @@ -67,4 +71,4 @@ jobs:

- name: Tear down Oracle XE test infra
working-directory: src/test/resources/docker/oracle-xe
run: docker-compose down --volumes
run: docker-compose down --volumes
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"snapshot": {
"objects": {
"liquibase.structure.core.Column": [
{
"column": {
"defaultValue": "LIQUIBASE.test_sequence.nextval\\!\\{liquibase.statement.DatabaseFunction\\}",
"name": "SEQUENCE_REFERENCED_COLUMN",
"nullable": true,
"type": {
"dataTypeId": "3\\!\\{java.lang.Integer\\}",
"typeName": "NUMBER"
}
}
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
INVALID TEST

addAutoIncrement is not supported for Oracle
--https://docs.liquibase.com/change-types/add-auto-increment.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE LIQUIBASE.posts ADD CONSTRAINT test_check_constraint CHECK (id > 0)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ALTER TABLE LIQUIBASE.authors ADD varcharColumn VARCHAR2(25)
ALTER TABLE LIQUIBASE.authors ADD intColumn INTEGER
ALTER TABLE LIQUIBASE.authors ADD dateColumn date
UPDATE LIQUIBASE.authors SET varcharColumn = 'INITIAL_VALUE'
UPDATE LIQUIBASE.authors SET intColumn = 5
UPDATE LIQUIBASE.authors SET dateColumn = TO_DATE('2020-09-21', 'YYYY-MM-DD')
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE LIQUIBASE.posts MODIFY title DEFAULT 'title_test'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE LIQUIBASE.authors ADD booleanColumn NUMBER(1)
ALTER TABLE LIQUIBASE.authors MODIFY booleanColumn DEFAULT 1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE LIQUIBASE.posts MODIFY inserted_date DEFAULT CURRENT_TIMESTAMP
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE LIQUIBASE.authors ADD dateTimeColumn TIMESTAMP
ALTER TABLE LIQUIBASE.authors MODIFY dateTimeColumn DEFAULT TO_DATE('2008-02-12 12:34:03', 'YYYY-MM-DD HH24:MI:SS')
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE LIQUIBASE.authors ADD numericColumn NUMBER
ALTER TABLE LIQUIBASE.authors MODIFY numericColumn DEFAULT 100000000
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE SEQUENCE LIQUIBASE.test_sequence START WITH 1 INCREMENT BY 1 MINVALUE 1
ALTER TABLE LIQUIBASE.authors ADD sequence_referenced_column NUMBER
ALTER TABLE LIQUIBASE.authors MODIFY sequence_referenced_column DEFAULT LIQUIBASE.test_sequence.nextval
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE LIQUIBASE.posts ADD CONSTRAINT fk_posts_authors_test FOREIGN KEY (author_id) REFERENCES LIQUIBASE.authors (id) ON DELETE CASCADE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE TABLE LIQUIBASE.authors_data AS SELECT DISTINCT email AS authors_email FROM LIQUIBASE.authors WHERE email IS NOT NULL
ALTER TABLE LIQUIBASE.authors_data ADD PRIMARY KEY (authors_email)
ALTER TABLE LIQUIBASE.authors ADD CONSTRAINT FK_AUTHORS_AUTHORS_DATA FOREIGN KEY (email) REFERENCES LIQUIBASE.authors_data (authors_email)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE LIQUIBASE.posts MODIFY inserted_date CONSTRAINT test_notNull NOT NULL
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE TABLE LIQUIBASE.test_table (id INTEGER, bit_col NUMBER(1), boolean_col NUMBER(1))
INSERT INTO LIQUIBASE.test_table (id) VALUES (1)
UPDATE LIQUIBASE.test_table SET bit_col = 1 WHERE bit_col IS NULL
ALTER TABLE LIQUIBASE.test_table MODIFY bit_col NOT NULL
UPDATE LIQUIBASE.test_table SET boolean_col = 1 WHERE boolean_col IS NULL
ALTER TABLE LIQUIBASE.test_table MODIFY boolean_col NOT NULL
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE TABLE LIQUIBASE.test_table_addpk (test_id INTEGER, test_column VARCHAR2(50))
ALTER TABLE LIQUIBASE.test_table_addpk ADD CONSTRAINT pk_test_table_addpk PRIMARY KEY (test_id)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE LIQUIBASE.authors ADD CONSTRAINT test_unique_constraint UNIQUE (email) DEFERRABLE INITIALLY DEFERRED
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE SEQUENCE LIQUIBASE.test_sequence START WITH 2 INCREMENT BY 1 MINVALUE 1
ALTER SEQUENCE LIQUIBASE.test_sequence INCREMENT BY 10 MINVALUE 1 MAXVALUE 371717 ORDER CACHE 9 CYCLE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE SEQUENCE LIQUIBASE.test_sequence START WITH 1 INCREMENT BY 1 MINVALUE 1 MAXVALUE 100 CYCLE
ALTER SEQUENCE LIQUIBASE.test_sequence NOCYCLE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE FUNCTION test_function(id IN NUMBER) RETURN VARCHAR2 AS BEGIN RETURN '2'; END
/
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE INDEX LIQUIBASE.idx_first_name ON LIQUIBASE.authors(first_name)
CREATE INDEX LIQUIBASE.idx_last_name ON LIQUIBASE.authors(last_name)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE PACKAGE test_package AS
PROCEDURE test_procedure
END test_package
/
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE OR REPLACE PACKAGE test_package
AS
PROCEDURE test_procedure
END test_package
/
CREATE OR REPLACE PACKAGE BODY test_package
IS
PROCEDURE test_procedure IS
BEGIN END test_procedure
END test_package
/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE OR REPLACE PROCEDURE test_procedure
AS
BEGIN
END
/
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE PROCEDURE test_procedure()
BEGIN
END
/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE SEQUENCE LIQUIBASE.test_sequence START WITH 1 INCREMENT BY 1 MINVALUE 1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE OR REPLACE PUBLIC SYNONYM test_synonym FOR LIQUIBASE.authors
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE TABLE LIQUIBASE.test_table (test_id INTEGER NOT NULL, test_column VARCHAR2(50) NOT NULL, CONSTRAINT PK_TEST_TABLE PRIMARY KEY (test_id))
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE TABLE LIQUIBASE.createTableDataTypeText (textCol CLOB)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE TABLE LIQUIBASE.lms_create_table_test (lms_test_id INTEGER, lms_test_timestamp TIMESTAMP)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE OR REPLACE TRIGGER test_trigger BEFORE INSERT ON posts BEGIN END
/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE VIEW LIQUIBASE.test_view AS select id, first_name, last_name, email from authors
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE TABLE LIQUIBASE."datatypes.character_test_table" ("varchar2.1" VARCHAR2(1), "varchar2.10" VARCHAR2(10), "varchar2.100" VARCHAR2(100), "varchar2.1000" VARCHAR2(1000))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE LIQUIBASE.posts ADD CONSTRAINT test_check_constraint CHECK (id > 0)
ALTER TABLE LIQUIBASE.posts DISABLE CONSTRAINT test_check_constraint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE OR REPLACE TRIGGER test_trigger BEFORE INSERT ON posts BEGIN END
/
ALTER TRIGGER LIQUIBASE.test_trigger DISABLE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE LIQUIBASE.posts ADD CONSTRAINT fk_posts_authors_test_1 FOREIGN KEY (author_id) REFERENCES LIQUIBASE.authors (id)
ALTER TABLE LIQUIBASE.posts ADD CONSTRAINT fk_posts_authors_test_2 FOREIGN KEY (id) REFERENCES LIQUIBASE.authors (id)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE LIQUIBASE.posts ADD CONSTRAINT test_check_constraint CHECK (id > 0)
ALTER TABLE LIQUIBASE.posts DROP CONSTRAINT test_check_constraint
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE LIQUIBASE.posts ADD varcharColumn VARCHAR2(25)
UPDATE LIQUIBASE.posts SET varcharColumn = 'INITIAL_VALUE'
ALTER TABLE LIQUIBASE.posts DROP COLUMN varcharColumn
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE LIQUIBASE.posts MODIFY title DEFAULT 'title_test'
ALTER TABLE LIQUIBASE.posts MODIFY title DEFAULT NULL
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE LIQUIBASE.posts ADD CONSTRAINT fk_posts_authors_test FOREIGN KEY (author_id) REFERENCES LIQUIBASE.authors (id) ON DELETE CASCADE
ALTER TABLE LIQUIBASE.posts DROP CONSTRAINT fk_posts_authors_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE FUNCTION test_function(id IN NUMBER) RETURN VARCHAR2 AS BEGIN RETURN '2'; END
/
DROP FUNCTION LIQUIBASE.test_function
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE INDEX LIQUIBASE.idx_first_name ON LIQUIBASE.authors(first_name)
DROP INDEX LIQUIBASE.idx_first_name
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE LIQUIBASE.posts MODIFY inserted_date CONSTRAINT test_notNull NOT NULL
ALTER TABLE LIQUIBASE.posts MODIFY inserted_date NULL
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE OR REPLACE PACKAGE test_package AS
PROCEDURE test_procedure
END test_package
/
DROP PACKAGE LIQUIBASE.test_package
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE OR REPLACE PACKAGE test_package
AS
PROCEDURE test_procedure
END test_package
/
CREATE OR REPLACE PACKAGE BODY test_package
IS
PROCEDURE test_procedure IS
BEGIN END test_procedure
END test_package
/
DROP PACKAGE BODY LIQUIBASE.test_package
DROP PACKAGE LIQUIBASE.test_package
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE TABLE LIQUIBASE.test_table_droppk (test_id INTEGER, test_column VARCHAR2(50))
ALTER TABLE LIQUIBASE.test_table_droppk ADD CONSTRAINT pk_test_table_droppk PRIMARY KEY (test_id)
ALTER TABLE LIQUIBASE.test_table_droppk DROP PRIMARY KEY DROP INDEX
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CREATE OR REPLACE PROCEDURE test_procedure
AS
BEGIN
END
/
DROP PROCEDURE LIQUIBASE.test_procedure
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE SEQUENCE LIQUIBASE.test_sequence START WITH 1 INCREMENT BY 1 MINVALUE 1
DROP SEQUENCE LIQUIBASE.test_sequence
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE OR REPLACE PUBLIC SYNONYM test_synonym FOR LIQUIBASE.authors
DROP PUBLIC SYNONYM test_synonym
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE TABLE LIQUIBASE.test_table (test_id INTEGER NOT NULL, test_column VARCHAR2(50) NOT NULL, CONSTRAINT PK_TEST_TABLE PRIMARY KEY (test_id))
DROP TABLE LIQUIBASE.test_table
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE OR REPLACE TRIGGER test_trigger BEFORE INSERT ON posts BEGIN END
/
DROP TRIGGER LIQUIBASE.test_trigger
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE LIQUIBASE.authors ADD CONSTRAINT test_unique_constraint UNIQUE (email) DEFERRABLE INITIALLY DEFERRED
ALTER TABLE LIQUIBASE.authors DROP CONSTRAINT test_unique_constraint DROP INDEX
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE VIEW LIQUIBASE.test_view AS select id, first_name, last_name, email from authors
DROP VIEW LIQUIBASE.test_view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE LIQUIBASE.posts ADD CONSTRAINT test_check_constraint CHECK (id > 0) DISABLE
ALTER TABLE LIQUIBASE.posts ENABLE CONSTRAINT test_check_constraint
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE OR REPLACE TRIGGER test_trigger BEFORE INSERT ON posts BEGIN END
/
ALTER TRIGGER LIQUIBASE.test_trigger DISABLE
/
ALTER TRIGGER LIQUIBASE.test_trigger ENABLE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE TABLE LIQUIBASE.test_table (test_id INTEGER NOT NULL, test_column VARCHAR2(50) NOT NULL, CONSTRAINT PK_TEST_TABLE PRIMARY KEY (test_id))
ALTER TABLE LIQUIBASE.test_table SET UNUSED COLUMN test_column
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE LIQUIBASE.full_name_table (first_name VARCHAR2(50), last_name VARCHAR2(50))
INSERT INTO LIQUIBASE.full_name_table (first_name) VALUES ('John')
UPDATE LIQUIBASE.full_name_table SET last_name = 'Doe' WHERE first_name='John'
INSERT INTO LIQUIBASE.full_name_table (first_name) VALUES ('Jane')
UPDATE LIQUIBASE.full_name_table SET last_name = 'Doe' WHERE first_name='Jane'
ALTER TABLE LIQUIBASE.full_name_table ADD full_name VARCHAR2(255)
UPDATE LIQUIBASE.full_name_table SET full_name = first_name || ' ' || last_name
ALTER TABLE LIQUIBASE.full_name_table DROP COLUMN first_name
ALTER TABLE LIQUIBASE.full_name_table DROP COLUMN last_name
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE TABLE LIQUIBASE.modify_data_type_test (intColumn INTEGER, dateColumn date)
ALTER TABLE LIQUIBASE.modify_data_type_test MODIFY intColumn VARCHAR2(50)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* prepend comment */ CREATE TABLE LIQUIBASE.test_table (test_id INTEGER NOT NULL, test_column VARCHAR2(50) NOT NULL) -- append comment
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE LIQUIBASE.authors RENAME COLUMN first_name TO first_name_renameColumn_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE SEQUENCE LIQUIBASE.test_sequence START WITH 1 INCREMENT BY 1 MINVALUE 1
RENAME test_sequence TO test_sequence_rename_test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE TABLE LIQUIBASE.oldnametable (test_id INTEGER NOT NULL, test_column VARCHAR2(50) NOT NULL, CONSTRAINT PK_OLDNAMETABLE PRIMARY KEY (test_id))
ALTER TABLE LIQUIBASE.oldnametable RENAME TO newnametable
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE OR REPLACE TRIGGER test_trigger BEFORE INSERT ON posts BEGIN END
/
ALTER TRIGGER LIQUIBASE.test_trigger RENAME TO test_trigger_renamed
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE VIEW LIQUIBASE.test_view AS select id, first_name, last_name, email from authors
RENAME test_view TO test_view_new
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
COMMENT ON COLUMN LIQUIBASE.authors.id IS 'A Test Column Remark'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
COMMENT ON TABLE LIQUIBASE.authors IS 'A Test Remark'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE TABLE LIQUIBASE.sqltest (id INTEGER)
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
@@ -0,0 +1,4 @@
CREATE TABLE LIQUIBASE.sqltest (id INTEGER)
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
@@ -0,0 +1,2 @@
INSERT INTO LIQUIBASE.posts (id, author_id, title, description, content, inserted_date) VALUES ('100', '10', 'value', 'value', 'value', '10-AUG-88')
DELETE FROM LIQUIBASE.posts WHERE id=100
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO LIQUIBASE.posts (id, author_id, title, description, content, inserted_date) VALUES ('10', '10', 'value', 'value', 'value', '10-AUG-88')
Loading

0 comments on commit d18ee27

Please sign in to comment.