Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Jan 16, 2025
2 parents aa17f1e + 020c0d7 commit 8b33145
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ public void patch(Statement stmt, ISqlCommonConfig config) throws SQLException {
DataScope.TABLE_INFORMATION, config instanceof SqlCommonConfig scc ? scc.tablePrefix() : "");

if (config instanceof SqliteConfig) {
stmt.execute("UPDATE " + table + " SET " + FIELD_TABLE_VERSION + " = '1' ");
stmt.execute("INSERT INTO " + table + " (" + FIELD_TABLE_VERSION + ") SELECT " + getVersion()
+ " WHERE NOT EXISTS (SELECT 1 FROM " + table + ");");
stmt.execute("UPDATE " + table + " SET " + FIELD_TABLE_VERSION + " = '1' WHERE rowid = (SELECT rowid FROM "
+ table + " LIMIT 1);");
} else {
stmt.execute("insert into " + table + " values (" + FIELD_TABLE_VERSION + " = '1');");
stmt.execute("UPDATE " + table + " SET " + FIELD_TABLE_VERSION + " = '1' LIMIT 1");
}

if (config instanceof MysqlConfig mysqlConf) {
Expand Down

0 comments on commit 8b33145

Please sign in to comment.