Merge branch 'FOCONIS-ddl-clickhouse'

This commit is contained in:
Rob Bygrave
2022-03-14 16:54:07 +13:00
6 changed files with 14 additions and 10 deletions
@@ -18,6 +18,8 @@ public class ClickHousePlatform extends DatabasePlatform {
//this.exceptionTranslator =
this.nativeUuidType = true;
this.dbDefaultValue.setNow("now()");
this.dbDefaultValue.setFalse("0");
this.dbDefaultValue.setTrue("1");
this.dbIdentity.setIdType(IdType.IDENTITY);
this.dbIdentity.setSupportsGetGeneratedKeys(false);
@@ -106,7 +106,9 @@ final class DScriptRunner implements ScriptRunner {
try (Connection connection = obtainConnection()) {
DdlRunner runner = new DdlRunner(useAutoCommit, scriptName, platformName);
runner.runAll(content, connection);
connection.commit();
if (!connection.getAutoCommit()) {
connection.commit();
}
runner.runNonTransactional(connection);
}
@@ -53,7 +53,7 @@ create table migtest_e_basic (
description String,
description_file blob,
some_date DateTime,
old_boolean UInt8 default false,
old_boolean UInt8 default 0,
old_boolean2 UInt8,
eref_id UInt32,
indextest1 String,
@@ -48,8 +48,8 @@ alter table migtest_e_basic alter column status2 drop default;
alter table migtest_e_basic alter column status2 set null;
alter table migtest_e_basic alter column user_id set null;
alter table migtest_e_basic add column new_string_field String default 'foo''bar';
alter table migtest_e_basic add column new_boolean_field UInt8 default true;
alter table migtest_e_basic add column new_boolean_field2 UInt8 default true;
alter table migtest_e_basic add column new_boolean_field UInt8 default 1;
alter table migtest_e_basic add column new_boolean_field2 UInt8 default 1;
alter table migtest_e_basic add column progress UInt32 default 0;
alter table migtest_e_basic add column new_integer UInt32 default 42;
alter table migtest_e_history alter column test_string UInt64;
@@ -59,11 +59,11 @@ alter table migtest_e_history2 add column test_string2 String;
alter table migtest_e_history2 add column test_string3 String default 'unknown';
alter table migtest_e_history2 add column new_column String;
alter table migtest_e_history4 alter column test_number UInt64;
alter table migtest_e_history5 add column test_boolean UInt8 default false;
alter table migtest_e_history5 add column test_boolean UInt8 default 0;
alter table migtest_e_history6 alter column test_number1 set default 42;
alter table migtest_e_history6 alter column test_number1 set not null;
alter table migtest_e_history6 alter column test_number2 set null;
alter table migtest_e_softdelete add column deleted UInt8 default false;
alter table migtest_e_softdelete add column deleted UInt8 default 0;
alter table migtest_oto_child add column master_id UInt64;
-- apply post alter
alter table migtest_e_basic add constraint ck_migtest_e_basic_status check ( status in ('N','A','I','?'));
@@ -30,7 +30,7 @@ alter table migtest_e_basic alter column status2 set not null;
alter table migtest_e_basic alter column user_id set default 23;
alter table migtest_e_basic alter column user_id set not null;
alter table migtest_e_basic add column description_file blob;
alter table migtest_e_basic add column old_boolean UInt8 default false;
alter table migtest_e_basic add column old_boolean UInt8 default 0;
alter table migtest_e_basic add column old_boolean2 UInt8;
alter table migtest_e_basic add column eref_id UInt32;
alter table migtest_e_history2 alter column test_string drop default;
@@ -1,6 +1,6 @@
-697238714, 1.0__initial.sql
-1523257380, 1.1.sql
1588846231, 1.0__initial.sql
-1102375855, 1.1.sql
1279151426, 1.2__dropsFor_1.1.sql
14388492, 1.3.sql
581928632, 1.3.sql
80209848, 1.4__dropsFor_1.3.sql