Skip to content
Merged
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,21 @@ public String getCreateTableSqlString(String tableName) {
case MYSQL:
case MARIADB:
case SQLITE:
case H2:
return String.format(
"CREATE TABLE IF NOT EXISTS %s (" +
"`key` VARCHAR(255) PRIMARY KEY," +
"status VARCHAR(32)," +
"owner VARCHAR(255)," +
"expires_at TIMESTAMP" +
")", tableName);
case H2:
return String.format(
"CREATE TABLE IF NOT EXISTS %s (" +
"\"key\" VARCHAR(255) PRIMARY KEY," +
"status VARCHAR(32)," +
"owner VARCHAR(255)," +
"expires_at TIMESTAMP" +
")", tableName);
case SQLSERVER:
return String.format(
"IF NOT EXISTS (SELECT * FROM sysobjects WHERE name='%s' AND xtype='U') " +
Expand Down Expand Up @@ -240,6 +247,7 @@ public String getDeleteLockSqlString(String tableName) {
switch (sqlDialect) {
case POSTGRESQL:
case ORACLE:
case H2:
return String.format("DELETE FROM %s WHERE \"key\" = ?", tableName);
case INFORMIX:
case DB2:
Expand All @@ -248,7 +256,7 @@ public String getDeleteLockSqlString(String tableName) {
return String.format("DELETE FROM %s WHERE lock_key = ?", tableName);
case SQLSERVER:
return String.format("DELETE FROM %s WHERE [key] = ?", tableName);
default: // MYSQL, MARIADB, SQLITE, H2
default: // MYSQL, MARIADB, SQLITE
return String.format("DELETE FROM %s WHERE `key` = ?", tableName);
}
}
Expand Down
Loading