mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
fix: Postgres schema upgrade using wrong syntax
This commit is contained in:
1 file changed
+3
-3
@@ -163,7 +163,7 @@ public class PostgreSqlDatabase extends Database {
|
|||||||
public int getSchemaVersion() {
|
public int getSchemaVersion() {
|
||||||
try (Connection connection = getConnection()) {
|
try (Connection connection = getConnection()) {
|
||||||
try (PreparedStatement statement = connection.prepareStatement(format("""
|
try (PreparedStatement statement = connection.prepareStatement(format("""
|
||||||
SELECT schema_version
|
SELECT "schema_version"
|
||||||
FROM "%meta_data%"
|
FROM "%meta_data%"
|
||||||
LIMIT 1;"""))) {
|
LIMIT 1;"""))) {
|
||||||
final ResultSet resultSet = statement.executeQuery();
|
final ResultSet resultSet = statement.executeQuery();
|
||||||
@@ -183,7 +183,7 @@ public class PostgreSqlDatabase extends Database {
|
|||||||
if (getSchemaVersion() == -1) {
|
if (getSchemaVersion() == -1) {
|
||||||
try (Connection connection = getConnection()) {
|
try (Connection connection = getConnection()) {
|
||||||
try (PreparedStatement insertStatement = connection.prepareStatement(format("""
|
try (PreparedStatement insertStatement = connection.prepareStatement(format("""
|
||||||
INSERT INTO "%meta_data%" (`schema_version`)
|
INSERT INTO "%meta_data%" ("schema_version")
|
||||||
VALUES (?)"""))) {
|
VALUES (?)"""))) {
|
||||||
insertStatement.setInt(1, version);
|
insertStatement.setInt(1, version);
|
||||||
insertStatement.executeUpdate();
|
insertStatement.executeUpdate();
|
||||||
@@ -197,7 +197,7 @@ public class PostgreSqlDatabase extends Database {
|
|||||||
try (Connection connection = getConnection()) {
|
try (Connection connection = getConnection()) {
|
||||||
try (PreparedStatement statement = connection.prepareStatement(format("""
|
try (PreparedStatement statement = connection.prepareStatement(format("""
|
||||||
UPDATE "%meta_data%"
|
UPDATE "%meta_data%"
|
||||||
SET `schema_version` = ?;"""))) {
|
SET "schema_version" = ?;"""))) {
|
||||||
statement.setInt(1, version);
|
statement.setInt(1, version);
|
||||||
statement.executeUpdate();
|
statement.executeUpdate();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user