diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9e7c39e5c..e83f3cfc8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -188,6 +188,7 @@ jobs: } } + - name: maven-settings-xml-action uses: whelk-io/maven-settings-xml-action@v21 with: @@ -197,7 +198,7 @@ jobs: "id": "liquibase", "url": "https://maven.pkg.github.com/liquibase/liquibase", "releases": { - "enabled": "false" + "enabled": "true" }, "snapshots": { "enabled": "true", @@ -208,7 +209,7 @@ jobs: "id": "liquibase-pro", "url": "https://maven.pkg.github.com/liquibase/liquibase-pro", "releases": { - "enabled": "false" + "enabled": "true" }, "snapshots": { "enabled": "true", @@ -230,6 +231,12 @@ jobs: } ] + - uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + cache: 'maven' + - name: Install Snapshot Liquibase if: steps.configure-build.outputs.useLiquibaseSnapshot == 'true' env: @@ -241,6 +248,14 @@ jobs: "-Dliquibase.sdk.repo=liquibase/liquibase,liquibase/liquibase-pro" \ "-Dliquibase.sdk.proWorkflowId=build.yml"\ "-Dliquibase.sdk.workflowId=run-tests.yml" + + mvn -B versions:set-property -Dproperty=liquibase-core.version -DnewVersion=0-SNAPSHOT + mvn liquibase-sdk:install-snapshot-cli \ + "-Dliquibase.sdk.branchSearch=${{ steps.configure-build.outputs.liquibaseBranch }},master,main,develop" \ + "-Dliquibase.sdk.repo=liquibase/liquibase,liquibase/liquibase-pro" \ + "-Dliquibase.sdk.proWorkflowId=build.yml" \ + "-Dliquibase.sdk.workflowId=run-tests.yml" + chmod -R 777 bin ls -l ./bin @@ -279,7 +294,7 @@ jobs: - uses: actions/setup-java@v4 with: - java-version: '11' + java-version: '17' distribution: 'temurin' cache: 'maven' diff --git a/pom.xml b/pom.xml index 037b8e3b2..eb7dff4ce 100644 --- a/pom.xml +++ b/pom.xml @@ -260,6 +260,8 @@ 0.10.23 ${env.GITHUB_TOKEN} + bin + true diff --git a/src/main/resources/liquibase/harness/change/expectedSnapshot/mariadb/addDefaultValueBoolean.json b/src/main/resources/liquibase/harness/change/expectedSnapshot/mariadb/addDefaultValueBoolean.json index 280c8908f..29c86c309 100644 --- a/src/main/resources/liquibase/harness/change/expectedSnapshot/mariadb/addDefaultValueBoolean.json +++ b/src/main/resources/liquibase/harness/change/expectedSnapshot/mariadb/addDefaultValueBoolean.json @@ -4,11 +4,11 @@ "liquibase.structure.core.Column": [ { "column": { - "defaultValue": "1\\!\\{liquibase.statement.DatabaseFunction\\}", + "defaultValue": "1\\!\\{java.lang.Integer\\}", "name": "booleanColumn", "nullable": true, "type": { - "typeName": "BOOLEAN" + "typeName": "TINYINT" } } } diff --git a/src/main/resources/liquibase/harness/change/expectedSnapshot/mariadb/addNotNullConstraintBitBoolean.json b/src/main/resources/liquibase/harness/change/expectedSnapshot/mariadb/addNotNullConstraintBitBoolean.json index 0897398e8..c31aa9cc4 100644 --- a/src/main/resources/liquibase/harness/change/expectedSnapshot/mariadb/addNotNullConstraintBitBoolean.json +++ b/src/main/resources/liquibase/harness/change/expectedSnapshot/mariadb/addNotNullConstraintBitBoolean.json @@ -16,7 +16,7 @@ "name": "boolean_col", "nullable": false, "type": { - "typeName": "BOOLEAN" + "typeName": "TINYINT" } } } diff --git a/src/main/resources/liquibase/harness/change/expectedSnapshot/mysql/addDefaultValueBoolean.json b/src/main/resources/liquibase/harness/change/expectedSnapshot/mysql/addDefaultValueBoolean.json index 0074d0f67..29c86c309 100644 --- a/src/main/resources/liquibase/harness/change/expectedSnapshot/mysql/addDefaultValueBoolean.json +++ b/src/main/resources/liquibase/harness/change/expectedSnapshot/mysql/addDefaultValueBoolean.json @@ -8,7 +8,7 @@ "name": "booleanColumn", "nullable": true, "type": { - "typeName": "BIT" + "typeName": "TINYINT" } } } diff --git a/src/main/resources/liquibase/harness/change/expectedSnapshot/mysql/addNotNullConstraintBitBoolean.json b/src/main/resources/liquibase/harness/change/expectedSnapshot/mysql/addNotNullConstraintBitBoolean.json index 2799536b9..c31aa9cc4 100644 --- a/src/main/resources/liquibase/harness/change/expectedSnapshot/mysql/addNotNullConstraintBitBoolean.json +++ b/src/main/resources/liquibase/harness/change/expectedSnapshot/mysql/addNotNullConstraintBitBoolean.json @@ -16,7 +16,7 @@ "name": "boolean_col", "nullable": false, "type": { - "typeName": "BIT" + "typeName": "TINYINT" } } } diff --git a/src/main/resources/liquibase/harness/change/expectedSnapshot/mysql/datatypes.numeric.json b/src/main/resources/liquibase/harness/change/expectedSnapshot/mysql/datatypes.numeric.json index 56b927e1d..e5069e5b8 100644 --- a/src/main/resources/liquibase/harness/change/expectedSnapshot/mysql/datatypes.numeric.json +++ b/src/main/resources/liquibase/harness/change/expectedSnapshot/mysql/datatypes.numeric.json @@ -55,7 +55,7 @@ "column": { "name": "bool", "type": { - "typeName": "BIT" + "typeName": "TINYINT" } } }, @@ -63,7 +63,7 @@ "column": { "name": "boolean", "type": { - "typeName": "BIT" + "typeName": "TINYINT" } } }, diff --git a/src/main/resources/liquibase/harness/change/expectedSnapshot/percona-xtradb-cluster/addDefaultValueBoolean.json b/src/main/resources/liquibase/harness/change/expectedSnapshot/percona-xtradb-cluster/addDefaultValueBoolean.json index 0074d0f67..29c86c309 100644 --- a/src/main/resources/liquibase/harness/change/expectedSnapshot/percona-xtradb-cluster/addDefaultValueBoolean.json +++ b/src/main/resources/liquibase/harness/change/expectedSnapshot/percona-xtradb-cluster/addDefaultValueBoolean.json @@ -8,7 +8,7 @@ "name": "booleanColumn", "nullable": true, "type": { - "typeName": "BIT" + "typeName": "TINYINT" } } } diff --git a/src/main/resources/liquibase/harness/change/expectedSnapshot/percona-xtradb-cluster/datatypes.numeric.json b/src/main/resources/liquibase/harness/change/expectedSnapshot/percona-xtradb-cluster/datatypes.numeric.json new file mode 100644 index 000000000..b779edde3 --- /dev/null +++ b/src/main/resources/liquibase/harness/change/expectedSnapshot/percona-xtradb-cluster/datatypes.numeric.json @@ -0,0 +1,173 @@ +{ + "snapshot": { + "objects": { + "liquibase.structure.core.Table": [ + { + "table": { + "name": "datatypes.numeric_test_table" + } + } + ], + "liquibase.structure.core.Column": [ + { + "column": { + "name": "bit", + "type": { + "typeName": "BIT" + } + } + }, + { + "column": { + "name": "bit1", + "type": { + "columnSize": "1\\!\\{java.lang.Integer\\}", + "typeName": "BIT" + } + } + }, + { + "column": { + "name": "bit64", + "type": { + "columnSize": "64\\!\\{java.lang.Integer\\}", + "typeName": "BIT" + } + } + }, + { + "column": { + "name": "tinyint", + "type": { + "typeName": "TINYINT" + } + } + }, + { + "column": { + "name": "tinyint.unsigned", + "type": { + "typeName": "TINYINT UNSIGNED" + } + } + }, + { + "column": { + "name": "bool", + "type": { + "typeName": "TINYINT" + } + } + }, + { + "column": { + "name": "boolean", + "type": { + "typeName": "TINYINT" + } + } + }, + { + "column": { + "name": "smallint", + "type": { + "typeName": "SMALLINT" + } + } + }, + { + "column": { + "name": "smallint.unsigned", + "type": { + "typeName": "SMALLINT UNSIGNED" + } + } + }, + { + "column": { + "name": "mediumint", + "type": { + "typeName": "MEDIUMINT" + } + } + }, + { + "column": { + "name": "mediumint.unsigned", + "type": { + "typeName": "MEDIUMINT UNSIGNED" + } + } + }, + { + "column": { + "name": "int", + "type": { + "typeName": "INT" + } + } + }, + { + "column": { + "name": "int.unsigned", + "type": { + "typeName": "INT UNSIGNED" + } + } + }, + { + "column": { + "name": "bigint", + "type": { + "typeName": "BIGINT" + } + } + }, + { + "column": { + "name": "bigint.unsigned", + "type": { + "typeName": "BIGINT UNSIGNED" + } + } + }, + { + "column": { + "name": "decimal", + "type": { + "typeName": "DECIMAL" + } + } + }, + { + "column": { + "name": "decimal.max", + "type": { + "columnSize": "65\\!\\{java.lang.Integer\\}", + "decimalDigits": "30\\!\\{java.lang.Integer\\}", + "typeName": "DECIMAL" + } + } + }, + { + "column": { + "name": "float", + "type": { + "typeName": "FLOAT" + } + } + }, + { + "column": { + "name": "float.10.10", + "type": { + "columnSize": "10\\!\\{java.lang.Integer\\}", + "decimalDigits": "10\\!\\{java.lang.Integer\\}", + "typeName": "FLOAT" + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/mariadb/addDefaultValueBoolean.sql b/src/main/resources/liquibase/harness/change/expectedSql/mariadb/addDefaultValueBoolean.sql index 6fb20d8af..a489f11c6 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/mariadb/addDefaultValueBoolean.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/mariadb/addDefaultValueBoolean.sql @@ -1,2 +1,2 @@ -ALTER TABLE lbcat.authors ADD booleanColumn TINYINT(1) NULL +ALTER TABLE lbcat.authors ADD booleanColumn TINYINT NULL ALTER TABLE lbcat.authors ALTER booleanColumn SET DEFAULT 1 \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/mariadb/addNotNullConstraintBitBoolean.sql b/src/main/resources/liquibase/harness/change/expectedSql/mariadb/addNotNullConstraintBitBoolean.sql index a77a9ce7d..6dc8db429 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/mariadb/addNotNullConstraintBitBoolean.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/mariadb/addNotNullConstraintBitBoolean.sql @@ -1,6 +1,6 @@ -CREATE TABLE lbcat.test_table (id INT NULL, bit_col BIT(1) NULL, boolean_col TINYINT(1) NULL) +CREATE TABLE lbcat.test_table (id INT NULL, bit_col BIT(1) NULL, boolean_col TINYINT NULL) INSERT INTO lbcat.test_table (id) VALUES (1) UPDATE lbcat.test_table SET bit_col = 1 WHERE bit_col IS NULL ALTER TABLE lbcat.test_table MODIFY bit_col BIT(1) NOT NULL UPDATE lbcat.test_table SET boolean_col = 1 WHERE boolean_col IS NULL -ALTER TABLE lbcat.test_table MODIFY boolean_col TINYINT(1) NOT NULL \ No newline at end of file +ALTER TABLE lbcat.test_table MODIFY boolean_col TINYINT NOT NULL \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/mysql/addDefaultValueBoolean.sql b/src/main/resources/liquibase/harness/change/expectedSql/mysql/addDefaultValueBoolean.sql index 6fb20d8af..a489f11c6 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/mysql/addDefaultValueBoolean.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/mysql/addDefaultValueBoolean.sql @@ -1,2 +1,2 @@ -ALTER TABLE lbcat.authors ADD booleanColumn TINYINT(1) NULL +ALTER TABLE lbcat.authors ADD booleanColumn TINYINT NULL ALTER TABLE lbcat.authors ALTER booleanColumn SET DEFAULT 1 \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/mysql/addNotNullConstraintBitBoolean.sql b/src/main/resources/liquibase/harness/change/expectedSql/mysql/addNotNullConstraintBitBoolean.sql index a77a9ce7d..6dc8db429 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/mysql/addNotNullConstraintBitBoolean.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/mysql/addNotNullConstraintBitBoolean.sql @@ -1,6 +1,6 @@ -CREATE TABLE lbcat.test_table (id INT NULL, bit_col BIT(1) NULL, boolean_col TINYINT(1) NULL) +CREATE TABLE lbcat.test_table (id INT NULL, bit_col BIT(1) NULL, boolean_col TINYINT NULL) INSERT INTO lbcat.test_table (id) VALUES (1) UPDATE lbcat.test_table SET bit_col = 1 WHERE bit_col IS NULL ALTER TABLE lbcat.test_table MODIFY bit_col BIT(1) NOT NULL UPDATE lbcat.test_table SET boolean_col = 1 WHERE boolean_col IS NULL -ALTER TABLE lbcat.test_table MODIFY boolean_col TINYINT(1) NOT NULL \ No newline at end of file +ALTER TABLE lbcat.test_table MODIFY boolean_col TINYINT NOT NULL \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/mysql/datatypes.numeric.sql b/src/main/resources/liquibase/harness/change/expectedSql/mysql/datatypes.numeric.sql index 3ada9492d..936c43664 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/mysql/datatypes.numeric.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/mysql/datatypes.numeric.sql @@ -1 +1 @@ -CREATE TABLE lbcat.`datatypes.numeric_test_table` (bit BIT NULL, bit1 BIT(1) NULL, bit64 BIT(64) NULL, `tinyint` TINYINT NULL, `tinyint.unsigned` TINYINT unsigned NULL, bool TINYINT(1) NULL, boolean TINYINT(1) NULL, `smallint` SMALLINT NULL, `smallint.unsigned` SMALLINT unsigned NULL, `mediumint` MEDIUMINT NULL, `mediumint.unsigned` MEDIUMINT unsigned NULL, `int` INT NULL, `int.unsigned` INT unsigned NULL, `bigint` BIGINT NULL, `bigint.unsigned` BIGINT unsigned NULL, `decimal` DECIMAL NULL, `decimal.max` DECIMAL(65, 30) NULL, `float` FLOAT NULL, `float.10.10` FLOAT(10, 10) NULL, double_precision_column DOUBLE PRECISION(5, 2) NULL, precision_column DOUBLE(5, 2) NULL) \ No newline at end of file +CREATE TABLE lbcat.`datatypes.numeric_test_table` (bit BIT NULL, bit1 BIT(1) NULL, bit64 BIT(64) NULL, `tinyint` TINYINT NULL, `tinyint.unsigned` TINYINT unsigned NULL, bool TINYINT NULL, boolean TINYINT NULL, `smallint` SMALLINT NULL, `smallint.unsigned` SMALLINT unsigned NULL, `mediumint` MEDIUMINT NULL, `mediumint.unsigned` MEDIUMINT unsigned NULL, `int` INT NULL, `int.unsigned` INT unsigned NULL, `bigint` BIGINT NULL, `bigint.unsigned` BIGINT unsigned NULL, `decimal` DECIMAL NULL, `decimal.max` DECIMAL(65, 30) NULL, `float` FLOAT NULL, `float.10.10` FLOAT(10, 10) NULL, double_precision_column DOUBLE PRECISION(5, 2) NULL, precision_column DOUBLE(5, 2) NULL) \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/percona-xtradb-cluster/addDefaultValueBoolean.sql b/src/main/resources/liquibase/harness/change/expectedSql/percona-xtradb-cluster/addDefaultValueBoolean.sql index 6fb20d8af..a489f11c6 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/percona-xtradb-cluster/addDefaultValueBoolean.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/percona-xtradb-cluster/addDefaultValueBoolean.sql @@ -1,2 +1,2 @@ -ALTER TABLE lbcat.authors ADD booleanColumn TINYINT(1) NULL +ALTER TABLE lbcat.authors ADD booleanColumn TINYINT NULL ALTER TABLE lbcat.authors ALTER booleanColumn SET DEFAULT 1 \ No newline at end of file diff --git a/src/main/resources/liquibase/harness/change/expectedSql/percona-xtradb-cluster/datatypes.numeric.sql b/src/main/resources/liquibase/harness/change/expectedSql/percona-xtradb-cluster/datatypes.numeric.sql index 5e58b08ad..964d4022c 100644 --- a/src/main/resources/liquibase/harness/change/expectedSql/percona-xtradb-cluster/datatypes.numeric.sql +++ b/src/main/resources/liquibase/harness/change/expectedSql/percona-xtradb-cluster/datatypes.numeric.sql @@ -1 +1 @@ -CREATE TABLE lbcat.`datatypes.numeric_test_table` (bit BIT NULL, bit1 BIT(1) NULL, bit64 BIT(64) NULL, `tinyint` TINYINT NULL, `tinyint.unsigned` TINYINT unsigned NULL, bool TINYINT(1) NULL, boolean TINYINT(1) NULL, `smallint` SMALLINT NULL, `smallint.unsigned` SMALLINT unsigned NULL, `mediumint` MEDIUMINT NULL, `mediumint.unsigned` MEDIUMINT unsigned NULL, `int` INT NULL, `int.unsigned` INT unsigned NULL, `bigint` BIGINT NULL, `bigint.unsigned` BIGINT unsigned NULL, `decimal` DECIMAL NULL, `decimal.max` DECIMAL(65, 30) NULL, `float` FLOAT NULL, `float.10.10` FLOAT(10, 10) NULL) \ No newline at end of file +CREATE TABLE lbcat.`datatypes.numeric_test_table` (bit BIT NULL, bit1 BIT(1) NULL, bit64 BIT(64) NULL, `tinyint` TINYINT NULL, `tinyint.unsigned` TINYINT unsigned NULL, bool TINYINT NULL, boolean TINYINT NULL, `smallint` SMALLINT NULL, `smallint.unsigned` SMALLINT unsigned NULL, `mediumint` MEDIUMINT NULL, `mediumint.unsigned` MEDIUMINT unsigned NULL, `int` INT NULL, `int.unsigned` INT unsigned NULL, `bigint` BIGINT NULL, `bigint.unsigned` BIGINT unsigned NULL, `decimal` DECIMAL NULL, `decimal.max` DECIMAL(65, 30) NULL, `float` FLOAT NULL, `float.10.10` FLOAT(10, 10) NULL) \ No newline at end of file