This is an automated email from the ASF dual-hosted git repository.
dimas pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new 6a516e097 fix: Correct schema version number in schema-v4.sql files
(#3690)
6a516e097 is described below
commit 6a516e0976f549ec4326f1de6b1324520c2a1f38
Author: Anand K Sankaran <[email protected]>
AuthorDate: Fri Feb 6 11:18:00 2026 -0800
fix: Correct schema version number in schema-v4.sql files (#3690)
- Update DatabaseType.java to allow schemaVersion up to 4
- Fix h2/schema-v4.sql to set version to 4 instead of 3
- Fix postgres/schema-v4.sql to set version to 4 instead of 3
Co-authored-by: Anand Kumar Sankaran <[email protected]>
---
.../org/apache/polaris/persistence/relational/jdbc/DatabaseType.java | 2 +-
persistence/relational-jdbc/src/main/resources/h2/schema-v4.sql | 2 +-
persistence/relational-jdbc/src/main/resources/postgres/schema-v4.sql | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git
a/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/DatabaseType.java
b/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/DatabaseType.java
index 1ae1b35a5..71a33db21 100644
---
a/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/DatabaseType.java
+++
b/persistence/relational-jdbc/src/main/java/org/apache/polaris/persistence/relational/jdbc/DatabaseType.java
@@ -50,7 +50,7 @@ public enum DatabaseType {
*/
public InputStream openInitScriptResource(int schemaVersion) {
// Preconditions check is simpler and more direct than a switch default
- if (schemaVersion <= 0 || schemaVersion > 3) {
+ if (schemaVersion <= 0 || schemaVersion > 4) {
throw new IllegalArgumentException("Unknown or invalid schema version "
+ schemaVersion);
}
diff --git a/persistence/relational-jdbc/src/main/resources/h2/schema-v4.sql
b/persistence/relational-jdbc/src/main/resources/h2/schema-v4.sql
index 0f2ac75cc..1e766a696 100644
--- a/persistence/relational-jdbc/src/main/resources/h2/schema-v4.sql
+++ b/persistence/relational-jdbc/src/main/resources/h2/schema-v4.sql
@@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS version (
MERGE INTO version (version_key, version_value)
KEY (version_key)
- VALUES ('version', 3);
+ VALUES ('version', 4);
-- H2 supports COMMENT, but some modes may ignore it
COMMENT ON TABLE version IS 'the version of the JDBC schema in use';
diff --git
a/persistence/relational-jdbc/src/main/resources/postgres/schema-v4.sql
b/persistence/relational-jdbc/src/main/resources/postgres/schema-v4.sql
index 47d4ea883..b1a5b5870 100644
--- a/persistence/relational-jdbc/src/main/resources/postgres/schema-v4.sql
+++ b/persistence/relational-jdbc/src/main/resources/postgres/schema-v4.sql
@@ -28,7 +28,7 @@ CREATE TABLE IF NOT EXISTS version (
version_value INTEGER NOT NULL
);
INSERT INTO version (version_key, version_value)
-VALUES ('version', 3)
+VALUES ('version', 4)
ON CONFLICT (version_key) DO UPDATE
SET version_value = EXCLUDED.version_value;
COMMENT ON TABLE version IS 'the version of the JDBC schema in use';