@@ -35,9 +35,6 @@ public String getCreateTableSqlString(String tableName) {
3535 case MYSQL :
3636 case MARIADB :
3737 case H2 :
38- case HSQLDB :
39- case FIREBIRD :
40- case INFORMIX :
4138 return String .format (
4239 "CREATE TABLE IF NOT EXISTS %s (" +
4340 "id %s PRIMARY KEY, " +
@@ -61,6 +58,30 @@ public String getCreateTableSqlString(String tableName) {
6158 "transaction_flag %s, " +
6259 "system_change %s" +
6360 ")" , tableName , getAutoIncrementType (), getClobType (), getBigIntType (), getClobType (), getBooleanType (), getBooleanType ());
61+ case FIREBIRD :
62+ return String .format (
63+ "CREATE TABLE %s (" +
64+ "id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, " +
65+ "execution_id VARCHAR(255), " +
66+ "stage_id VARCHAR(255), " +
67+ "task_id VARCHAR(255), " +
68+ "author VARCHAR(255), " +
69+ "created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, " +
70+ "state VARCHAR(255), " +
71+ "class_name VARCHAR(255), " +
72+ "method_name VARCHAR(255), " +
73+ "metadata BLOB SUB_TYPE TEXT, " +
74+ "execution_millis BIGINT, " +
75+ "execution_hostname VARCHAR(255), " +
76+ "error_trace BLOB SUB_TYPE TEXT, " +
77+ "type VARCHAR(50), " +
78+ "tx_type VARCHAR(50), " +
79+ "target_system_id VARCHAR(255), " +
80+ "order_col VARCHAR(50), " +
81+ "recovery_strategy VARCHAR(50), " +
82+ "transaction_flag SMALLINT, " +
83+ "system_change SMALLINT" +
84+ ")" , tableName );
6485 case POSTGRESQL :
6586 return String .format (
6687 "CREATE TABLE IF NOT EXISTS %s (" +
@@ -87,7 +108,6 @@ public String getCreateTableSqlString(String tableName) {
87108 ")" , tableName );
88109
89110 case SQLSERVER :
90- case SYBASE :
91111 return String .format (
92112 "IF NOT EXISTS (SELECT * FROM sysobjects WHERE name='%s' AND xtype='U') " +
93113 "CREATE TABLE %s (" +
@@ -112,6 +132,35 @@ public String getCreateTableSqlString(String tableName) {
112132 "transaction_flag %s, " +
113133 "system_change %s" +
114134 ")" , tableName , tableName , getAutoIncrementType (), getClobType (), getBigIntType (), getClobType (), getBooleanType (), getBooleanType ());
135+ case SYBASE :
136+ return String .format (
137+ "IF NOT EXISTS (SELECT 1 FROM sysobjects WHERE name='%s' AND type='U') " +
138+ "BEGIN " +
139+ " EXEC('CREATE TABLE %s (" +
140+ " id BIGINT IDENTITY PRIMARY KEY, " +
141+ " execution_id VARCHAR(255), " +
142+ " stage_id VARCHAR(255), " +
143+ " task_id VARCHAR(255), " +
144+ " author VARCHAR(255), " +
145+ " created_at DATETIME, " +
146+ " state VARCHAR(32), " +
147+ " class_name VARCHAR(255), " +
148+ " method_name VARCHAR(255), " +
149+ " metadata TEXT, " +
150+ " execution_millis BIGINT, " +
151+ " execution_hostname VARCHAR(255), " +
152+ " error_trace TEXT, " +
153+ " type VARCHAR(64), " +
154+ " tx_type VARCHAR(64), " +
155+ " target_system_id VARCHAR(255), " +
156+ " order_col VARCHAR(255), " +
157+ " recovery_strategy VARCHAR(64), " +
158+ " transaction_flag BIT NOT NULL, " +
159+ " system_change BIT NOT NULL" +
160+ " )') " +
161+ "END" ,
162+ tableName , tableName
163+ );
115164 case ORACLE :
116165 return String .format (
117166 "BEGIN EXECUTE IMMEDIATE 'CREATE TABLE %s (" +
@@ -189,6 +238,32 @@ public String getCreateTableSqlString(String tableName) {
189238 "transaction_flag INTEGER, " +
190239 "system_change INTEGER" +
191240 ")" , tableName );
241+ case INFORMIX :
242+ return String .format (
243+ "CREATE TABLE IF NOT EXISTS %s (" +
244+ "id SERIAL8 PRIMARY KEY, " +
245+ "execution_id VARCHAR(100), " +
246+ "stage_id VARCHAR(100), " +
247+ "task_id VARCHAR(100), " +
248+ "author VARCHAR(100), " +
249+ "created_at DATETIME YEAR TO FRACTION(3) DEFAULT CURRENT YEAR TO FRACTION(3), " +
250+ "state VARCHAR(50), " +
251+ "class_name VARCHAR(200), " +
252+ "method_name VARCHAR(100), " +
253+ "metadata LVARCHAR(8000), " +
254+ "execution_millis BIGINT, " +
255+ "execution_hostname VARCHAR(100), " +
256+ "error_trace LVARCHAR(8000), " +
257+ "type VARCHAR(50), " +
258+ "tx_type VARCHAR(50), " +
259+ "target_system_id VARCHAR(100), " +
260+ "order_col VARCHAR(50), " +
261+ "recovery_strategy VARCHAR(50), " +
262+ "transaction_flag BOOLEAN, " +
263+ "system_change BOOLEAN" +
264+ ")" , tableName );
265+
266+
192267 default :
193268 throw new UnsupportedOperationException ("Dialect not supported for CREATE TABLE: " + sqlDialect .name ());
194269 }
@@ -217,7 +292,6 @@ private String getAutoIncrementType() {
217292 return "BIGSERIAL" ;
218293 case SQLITE :
219294 case H2 :
220- case HSQLDB :
221295 case DB2 :
222296 case FIREBIRD :
223297 return "BIGINT GENERATED BY DEFAULT AS IDENTITY" ;
@@ -242,7 +316,6 @@ private String getClobType() {
242316 return "LONGTEXT" ;
243317 case SQLITE :
244318 case H2 :
245- case HSQLDB :
246319 case FIREBIRD :
247320 case INFORMIX :
248321 case ORACLE :
@@ -273,7 +346,6 @@ private String getBooleanType() {
273346 return "TINYINT(1)" ;
274347 case POSTGRESQL :
275348 case H2 :
276- case HSQLDB :
277349 case FIREBIRD :
278350 case INFORMIX :
279351 return "BOOLEAN" ;
0 commit comments