Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
000f5b7
[Build] Run all tests on PostgreSQL 18 in CI
shba24 Oct 16, 2026
59ade4d
[Build] Describe the test-database input in plain words
shba24 Oct 24, 2026
19089ee
[Build] Run all tests on MySQL 8.4
shba24 Oct 24, 2026
170fdae
[Server] Return table columns in their declared order
shba24 Oct 24, 2026
0026554
[Server] Warn when a MySQL database compares text case-insensitively
shba24 Oct 24, 2026
7935437
[Build] Build MySQL test databases from a template, like PostgreSQL
shba24 Oct 24, 2026
6218571
[Server] Address review comments on the MySQL test harness
shba24 Oct 24, 2026
e5f9dc4
[Server] Run the MySQL Delta commit tests through the shared harness
shba24 Oct 24, 2026
f76aa8e
[Server] Inject test databases with @TempDatabase
shba24 Oct 24, 2026
d9c5f38
[Build] Pin the PostgreSQL and MySQL test images by digest
shba24 Oct 24, 2026
5fcf01c
[Build] Explain the test-only server settings of the MySQL and Postgr…
shba24 Oct 24, 2026
5542c61
[Server] Explain the isolation-level test and the MySQL template's ha…
shba24 Oct 24, 2026
75fa5d8
[Server] Add Flyway with the 0.7 baseline and the first migration step
shba24 Oct 24, 2026
fc3717f
[Server] Add bin/uc-migrate to set up and upgrade the schema with Flyway
shba24 Oct 24, 2026
3baa9d2
[Server] Start only on the current schema version; set up empty datab…
shba24 Oct 24, 2026
0175f4d
[Server] Make text comparisons case-sensitive on existing MySQL datab…
shba24 Oct 24, 2026
56e8dbb
[Server] Build test schemas with the migration steps
shba24 Oct 24, 2026
b22f20b
[Docs] Add the schema upgrade guide
shba24 Oct 24, 2026
8a52b91
[Server] Address review comments on the Flyway migration
shba24 Oct 24, 2026
7c21f5a
[Server] Test upgrades from the base code, the latest release, and 0.…
shba24 Oct 24, 2026
52dcb6b
[Build] Leave the project's own classes out of the launcher classpath
shba24 Oct 24, 2026
30c9cda
[Server] Migrate the sample database to the current schema version
shba24 Oct 24, 2026
8347828
[Server] Rename Migrator to SchemaMigrator and nest its small types
shba24 Oct 24, 2026
b89c59f
[Server] Upgrade the database schema when the server starts
shba24 Oct 24, 2026
e10be63
[Server] Name the baseline release once and refuse databases from bef…
shba24 Oct 24, 2026
3260601
[Server] Run the base commit's server jar in the upgrade tests, not a…
shba24 Oct 24, 2026
c43e2f1
[Build] Run the upgrade tests in their own path-filtered workflow
shba24 Oct 24, 2026
9e96446
[Server] Test upgrades along the release chain, with every column type
shba24 Oct 24, 2026
477b3eb
[Build] Build the base and release jars in the upgrade workflow
shba24 Oct 24, 2026
fd9b251
[Server] Test upgrades along every release from the baseline, each wr…
shba24 Oct 24, 2026
821059a
[Server] Address the review of the Flyway migration
shba24 Oct 25, 2026
35993c6
[Server] Leave the Helm chart to its own pull requests
shba24 Oct 25, 2026
f8f9f6c
[Server] Name UC's schema history table uc_schema_history and log whi…
shba24 Oct 25, 2026
f077d9d
[Server] Leave MySQL's collation to the startup warning for now
shba24 Oct 25, 2026
061f718
[Server] Refuse pre-0.7 databases by one table 0.7.0 added (stop-gap)
shba24 Oct 25, 2026
fc67536
[Server] Leave failed steps to Flyway's own check
shba24 Oct 25, 2026
6697235
[Server] Drop the hibernate.default_schema refusal
shba24 Oct 25, 2026
fc0903e
[Server] Drop the connection pool size check
shba24 Oct 25, 2026
57f1adb
[Server] Run the migrator on the caller's connection pool only
shba24 Oct 25, 2026
7d2ccab
[Server] Keep three server-start tests; MigratorTest covers the rest
shba24 Oct 25, 2026
172b4ee
[Server] Drop the test duplicating the not-a-UC-database case
shba24 Oct 25, 2026
fdff437
[Server] Take the build's version from VersionUtils in the upgrade tests
shba24 Oct 25, 2026
5b6d63f
[Server] Build old server jars only from their tags in the upgrade tests
shba24 Oct 25, 2026
c6abb52
[Build] Run the upgrade test in one job per database
shba24 Oct 25, 2026
16393fa
[Docs] Fold the first-start section of the upgrade guide into its intro
shba24 Oct 25, 2026
09a2eb5
[Server] Keep the upgrade test helpers package-private beside their t…
shba24 Oct 25, 2026
4005de2
[Server] Fold the release chain and jar build into OldServer
shba24 Oct 25, 2026
35e32bc
[Server] One migrate() entry point and a smaller run lock
shba24 Oct 25, 2026
6bcc21b
[Server] Stop on any run lock failure, and test the lock and failed s…
shba24 Oct 25, 2026
bbfee7a
[Server] Address the review of the trimmed Flyway migration
shba24 Oct 25, 2026
d4d1d2b
[Server] Migrate on the migrator's own pool and refuse Hibernate sche…
shba24 Oct 25, 2026
11c2f35
[Server] Run this commit's shaded jar in the upgrade test; drop the h…
shba24 Oct 25, 2026
a9adeb3
[Server] Refuse Hibernate's own schema settings and injected schema u…
shba24 Oct 25, 2026
f204822
[Server] Test two runs starting at once on an empty database, and a s…
shba24 Oct 25, 2026
3efb983
[Server] Bring back the in-JVM H2 run lock and test concurrent runs o…
shba24 Oct 25, 2026
6886e88
[Build] Run all tests on MySQL 8.4
shba24 Oct 24, 2026
fc98904
[Server] Return table columns in their declared order
shba24 Oct 24, 2026
34f8f62
[Server] Warn when a MySQL database compares text case-insensitively
shba24 Oct 24, 2026
b2cb4c3
[Build] Build MySQL test databases from a template, like PostgreSQL
shba24 Oct 24, 2026
bf6c7b1
[Server] Address review comments on the MySQL test harness
shba24 Oct 24, 2026
225f99f
[Server] Run the MySQL Delta commit tests through the shared harness
shba24 Oct 24, 2026
e233e6b
[Server] Inject test databases with @TempDatabase
shba24 Oct 24, 2026
1a96084
[Build] Pin the PostgreSQL and MySQL test images by digest
shba24 Oct 24, 2026
10c4cd7
[Build] Explain the test-only server settings of the MySQL and Postgr…
shba24 Oct 24, 2026
944a1dc
[Server] Explain the isolation-level test and the MySQL template's ha…
shba24 Oct 24, 2026
ff4e42d
[Build] Run the index-limit test on MySQL
shba24 Oct 26, 2026
7acb427
Merge main into stack/uc-flyway-schema
shba24 Oct 27, 2026
7964bdf
Merge stack/uc-mysql-suite (rebased #2044) into stack/uc-flyway-schema
shba24 Oct 27, 2026
faa1b12
[Docs] Say how to back up the database and find sessions holding locks
shba24 Oct 27, 2026
502e521
[Build] Clarify the test database harness comments
shba24 Oct 27, 2026
c5de03b
Merge stack/uc-mysql-suite (#2044): harness comment fixes into stack/…
shba24 Oct 27, 2026
41fb10e
[Server] Check each database's isolation level in the lock re-read test
shba24 Oct 27, 2026
5df45ca
Merge stack/uc-mysql-suite (#2044): per-database isolation check into…
shba24 Oct 27, 2026
6c0d604
[Build] Run all tests on MySQL 8.4
shba24 Oct 24, 2026
cc70790
[Server] Return table columns in their declared order
shba24 Oct 24, 2026
d63d59e
[Server] Warn when a MySQL database compares text case-insensitively
shba24 Oct 24, 2026
4b2a438
[Build] Build MySQL test databases from a template, like PostgreSQL
shba24 Oct 24, 2026
1fe089f
[Server] Address review comments on the MySQL test harness
shba24 Oct 24, 2026
e08c15b
[Server] Run the MySQL Delta commit tests through the shared harness
shba24 Oct 24, 2026
ea0ad3b
[Server] Inject test databases with @TempDatabase
shba24 Oct 24, 2026
fd79c58
[Build] Pin the PostgreSQL and MySQL test images by digest
shba24 Oct 24, 2026
39d29f6
[Build] Explain the test-only server settings of the MySQL and Postgr…
shba24 Oct 24, 2026
b859fc3
[Server] Explain the isolation-level test and the MySQL template's ha…
shba24 Oct 24, 2026
4efa2fb
[Build] Run the index-limit test on MySQL
shba24 Oct 26, 2026
a4092d0
[Build] Clarify the test database harness comments
shba24 Oct 27, 2026
3ee212e
[Server] Check each database's isolation level in the lock re-read test
shba24 Oct 27, 2026
b41d526
Bridge old #2044 head
shba24 Oct 28, 2026
505a3de
Merge stack/uc-mysql-suite (rebased #2044) into stack/uc-flyway-schema
shba24 Oct 28, 2026
2ec4ce9
[Server] Describe the MySQL collation without claiming names are case…
shba24 Oct 28, 2026
ba61cf5
[Build] Drop the half-built MySQL database when cloning the template …
shba24 Oct 28, 2026
3eacb82
[Server] Submit the function parameters out of position order in the …
shba24 Oct 28, 2026
421f6d9
[Server] Leave the derived-table DELETE note to DeltaCommitRepository
shba24 Oct 28, 2026
f842166
Merge stack/uc-mysql-suite (#2044): review fixes into stack/uc-flyway…
shba24 Oct 28, 2026
f000906
[Build] Fail a MySQL test that leaks a transaction instead of hanging…
shba24 Oct 29, 2026
b2c9fdf
Merge stack/uc-mysql-suite (#2044): MySQL lock wait timeout into stac…
shba24 Oct 29, 2026
469b6fd
[Server] Do not fail startup when the MySQL collation check throws
shba24 Oct 29, 2026
ebec639
[Server] Warn about case-insensitive MySQL by reading the columns' co…
shba24 Oct 29, 2026
b7d444e
Merge stack/uc-mysql-suite (#2044): collation check into stack/uc-fly…
shba24 Oct 29, 2026
627bfc4
[Server] Tidy the MySQL collation check and document converting an ex…
shba24 Oct 29, 2026
bd44bb2
Merge stack/uc-mysql-suite (#2044): collation check tidy into stack/u…
shba24 Oct 29, 2026
f17599e
Merge main into stack/uc-flyway-schema
shba24 Oct 29, 2026
a9cc3e7
Merge main into stack/uc-flyway-schema
shba24 Oct 31, 2026
251da42
[Server] Accept jdbc:mysql+srv: URLs and drop an untracked TODO
shba24 Nov 2, 2026
9958ebb
[Server] Refuse schema-changing Hibernate settings before Hibernate r…
shba24 Nov 3, 2026
e56a084
[Server] Also refuse schema actions from JVM properties and contribut…
shba24 Nov 3, 2026
92cd662
[Server] Refuse a default schema from JVM properties too; say the run…
shba24 Nov 3, 2026
abadd24
[Server] Drop the explicit cleanDisabled(true) that Flyway 13.10.3 al…
shba24 Nov 3, 2026
fe3f8ec
[Server] Restore the hbm2ddl.auto=none line in ManagedTableCleanupTas…
shba24 Nov 3, 2026
c5811c0
[Server] Run the pool-by-data-source-class migration test on PostgreS…
shba24 Nov 3, 2026
ada162f
[Server] Merge the two run-lock refusal tests into one parameterized …
shba24 Nov 3, 2026
aec18e0
[Server] Drop the schema-newer test from SchemaGateTest; MigratorTest…
shba24 Nov 3, 2026
5d31c3f
[Server] Test that a database whose driver reports another product is…
shba24 Nov 3, 2026
fdf3c05
[Server] Use java.lang.reflect.InvocationHandler for the test proxies
shba24 Nov 3, 2026
dee7796
[Server] Name the run lock SQL per database and use if/else for the s…
shba24 Nov 3, 2026
30a68ec
[Server] Split SchemaSnapshot.read and OldServer.run into named steps
shba24 Nov 3, 2026
4cc2e66
[Server] Shorten the migration test waits to 30 seconds and 1 minute
shba24 Nov 3, 2026
93d7f33
[Server] Set hbm2ddl halt-on-error to false only for MySQL in the bas…
shba24 Nov 3, 2026
3ead898
[Server] Keep the upgrade test's storage in a temp directory, not /tm…
shba24 Nov 3, 2026
1c8b236
[Server] Check the MySQL collation after the schema migration, so a f…
shba24 Nov 3, 2026
f3a2ef9
[Server] Fix migration docs and comments: name the upgrade test, drop…
shba24 Nov 3, 2026
6493f61
[Server] Rename MigratorTest to SchemaMigratorTest, and the baseline …
shba24 Nov 3, 2026
d9f4f80
[Server] Make the baseline test stop on entity DDL errors except on M…
shba24 Nov 4, 2026
fe2b66f
[Server] Re-wrap two test comments broken mid-sentence
shba24 Nov 4, 2026
df5e590
[Server] Rename SchemaMigrator.BASELINE_RELEASE to ADOPTED_RELEASE
shba24 Nov 4, 2026
ce1fc10
[Server] Document that the MySQL run lock is not shared across primaries
shba24 Nov 4, 2026
96c9dcf
[Server] Refuse H2 in server mode for the schema migration
shba24 Nov 4, 2026
134c444
[Server] Refuse every form of H2 server mode, and drop a stray test d…
shba24 Nov 4, 2026
a3de3e4
Merge main into stack/uc-flyway-schema
shba24 Nov 4, 2026
b8b8c39
[Server] Give KeyMapperTest a database built by the schema steps
shba24 Nov 4, 2026
a80afaa
[Server] Read only the configured schema's tables when classifying th…
shba24 Nov 4, 2026
ae832c1
[Helm] Stop rendering hibernate.hbm2ddl.auto=update
shba24 Nov 4, 2026
c5f0e52
[Server] Write the baseline step so that it can run again
shba24 Nov 4, 2026
a8ebffc
[Server] Run the schema steps only through bin/start-uc-server --upgr…
shba24 Nov 4, 2026
4902709
[Server] Leave the real-release upgrade tests to the pull request tha…
shba24 Nov 4, 2026
aa4b529
[Docs] Describe the schema steps as an optional command run by hand
shba24 Nov 4, 2026
bbc8ae7
[Server] Test that --upgrade-schema refuses a database with a failed …
shba24 Nov 4, 2026
dfe0306
Merge main into stack/uc-flyway-schema
shba24 Nov 4, 2026
19dc3f4
[Server] Name the clashing table when a step's index is missing
shba24 Nov 5, 2026
0e12be7
[Server] Describe what --upgrade-schema does now, and refuse unsafe c…
shba24 Nov 5, 2026
1d1bf0a
[Server] Refuse a missing step index, an escaped AUTO_SERVER and jdbc…
shba24 Nov 5, 2026
f1a82bc
Merge main into stack/uc-flyway-schema
shba24 Nov 5, 2026
3f24789
Merge main into stack/uc-flyway-schema
shba24 Nov 6, 2026
2d909b9
[Server] Refuse Unity Catalog tables that the search_path reaches later
shba24 Nov 6, 2026
3889418
[Server] Give the index-clash refusal a recovery that works
shba24 Nov 6, 2026
e2c270b
[Server] Pin the index-clash recovery in its test
shba24 Nov 6, 2026
3bb7bd0
[Server] Drop the unknown-product refusal test
shba24 Nov 6, 2026
4eb147b
[Docs] Restore main's MySQL collation paragraph
shba24 Nov 6, 2026
315b331
[Server] Drop the unused serverSetting parameter in SchemaGateTest
shba24 Nov 6, 2026
89edc7e
[Server] Make indexClashHint private
shba24 Nov 6, 2026
fee217f
[Docs] Correct three upgrade-schema claims
shba24 Nov 6, 2026
25ddcfb
[Server] Trim comments that restate the code
shba24 Nov 6, 2026
69f5961
[Server] Read H2's AUTO_SERVER as on only for H2's true values
shba24 Nov 6, 2026
be138b9
[Server] Upgrade the current schema when a later schema has an old copy
shba24 Nov 6, 2026
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
11 changes: 10 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ lazy val micrometerVersion = "1.17.0"
lazy val nettyVersion = "4.2.18.Final"
lazy val nettyTcnativeVersion = "2.0.84.Final"
lazy val postgresqlVersion = "42.7.14"
lazy val flywayVersion = "13.10.3"
// Keep in step with the Caffeine version iceberg-core depends on (2.9.3 in Iceberg 1.11.0).
lazy val caffeineVersion = "2.9.3"
lazy val junitJupiterVersion = "5.13.4"
Expand Down Expand Up @@ -97,6 +98,8 @@ lazy val commonSettings = Seq(
autoScalaLibrary := false,
crossPaths := false, // No scala cross building
assembly / assemblyMergeStrategy := {
// Merged, not dropped: Flyway finds its database support through its ServiceLoader file.
case PathList("META-INF", "services", f) if f.startsWith("org.flywaydb") => MergeStrategy.filterDistinctLines
// Keep the Log4j provider registration that adds request_id to log lines.
case PathList("META-INF", "services", "org.apache.logging.log4j.core.util.ContextDataProvider") =>
MergeStrategy.concat
Expand All @@ -117,7 +120,10 @@ lazy val commonSettings = Seq(
targetDir = packageFile.getParentFile,
// Also include the jar being built (packageFile) in the classpath
// This is specifically required by the server project since the server and control models are provided dependencies
classpath = (Runtime / dependencyClasspath).value :+ Attributed.blank(packageFile)
// The jar replaces the project's own class directory: with both, Flyway finds every
// migration step twice.
classpath = (Runtime / dependencyClasspath).value
.filterNot(_.data == (Compile / classDirectory).value) :+ Attributed.blank(packageFile)
)
packageFile
},
Expand Down Expand Up @@ -426,6 +432,9 @@ lazy val server = (project in file("server"))

"org.hibernate.orm" % "hibernate-core" % "6.5.0.Final",
"com.zaxxer" % "HikariCP" % "7.1.0",
"org.flywaydb" % "flyway-core" % flywayVersion,
"org.flywaydb" % "flyway-database-postgresql" % flywayVersion,
"org.flywaydb" % "flyway-mysql" % flywayVersion,

"jakarta.activation" % "jakarta.activation-api" % "2.1.3",
"net.bytebuddy" % "byte-buddy" % "1.14.15",
Expand Down
5 changes: 4 additions & 1 deletion docs/server/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ To deploy on Kubernetes, see [Deploy with Helm](helm.md).
that are created.
- If you configure local storage, the server reads and writes it with its own identity; see
[Local file system storage](./configuration.md#local-file-system-storage) before letting other users write to it.
- The `etc/db/` directory contains the backend database that is used by the UC server.
- The `etc/db/` directory contains the backend database that is used by the UC server. By default
this is an H2 database file, `h2db.mv.db`. H2 supports one server per file; to run more than one server, use
PostgreSQL or MySQL. H2's server mode (`AUTO_SERVER=TRUE`, `jdbc:h2:tcp:` or `jdbc:h2:ssl:`) is
refused by `bin/start-uc-server --upgrade-schema` (see [Upgrading the database schema](upgrades.md)).

### Configuring the database

Expand Down
88 changes: 88 additions & 0 deletions docs/server/upgrades.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Upgrading the database schema

Unity Catalog uses [Flyway](https://flywaydb.org/) to manage the schema of its database. Each
release ships the schema steps it needs, and each step is applied once and recorded in the
`uc_schema_history` table.

For now the schema steps are optional, and you run them by hand. The server still lets Hibernate
update the schema when it starts (`hibernate.hbm2ddl.auto=update` in
`etc/conf/hibernate.properties`). The steps build the same schema, so on a database that the steps
set up, Hibernate changes nothing.

`bin/start-uc-server --upgrade-schema` brings the database to the schema version of its release,
then exits without starting the server: with 0 when it succeeds, and with 1 and the reason when it
refuses. It sets up an empty database (a new install) and applies the steps that are not applied
yet. It refuses a database that has Unity Catalog's tables but no schema history, such as one that
a server set up when it started.

## Upgrading to a new release
Comment thread
shba24 marked this conversation as resolved.
Resolved

Run the commands with the new release.

1. Stop all servers.
2. Back up the database (see [Backing up the database](#backing-up-the-database)).
3. Upgrade the schema:

```sh
bin/start-uc-server --upgrade-schema
```

It applies the pending steps and logs what it applied.

4. Start the new release:

```sh
bin/start-uc-server
```

On PostgreSQL and MySQL, `--upgrade-schema` takes a lock, so when several run at the same time, one
applies the steps and the others wait for it. It holds that lock on one database session for the
whole run, so connect to the database directly or through a pooler in session mode, not in
transaction mode (PgBouncer's `pool_mode = transaction`): there the lock can be released on
another session, and the command fails.
On MySQL the lock is a named lock (`GET_LOCK`), which Group Replication in multi-primary mode does
not share between primaries: there, run `--upgrade-schema` on one host only.

A step waits for locks that other sessions hold on its table, for example an open transaction of
a reporting tool. If `--upgrade-schema` stays at a step for long, look for such sessions and end
them: `SELECT pid, state, query FROM pg_stat_activity WHERE datname = current_database()` on
PostgreSQL, `SHOW PROCESSLIST` on MySQL.

## Backing up the database

Take the backup with all servers stopped, so that it holds no half-written change. The examples use
the database `ucdb`.

- PostgreSQL: `pg_dump -Fc -d ucdb -f uc-backup.dump`. To restore it, create an empty database and
run `pg_restore -d ucdb uc-backup.dump`.
- MySQL: `mysqldump --single-transaction --databases ucdb > uc-backup.sql`. To restore it, drop the
database and run `mysql < uc-backup.sql`.
- H2: copy the database file, `etc/db/h2db.mv.db` with the default
`hibernate.connection.url`. To restore it, copy it back.
- A managed database (for example Amazon RDS or Cloud SQL): a snapshot of the instance works too.

## Messages

Messages that `--upgrade-schema` prints when it refuses, and what to do.

`The database's schema history does not match this release's schema steps: <reasons>`
: Flyway's check of `uc_schema_history` failed, for example because a recorded step differs from
this release's step of the same version (its checksum), or this release lacks a recorded step.
`<reasons>` may advise Flyway's `repair` command, which Unity Catalog doesn't have. Run the release
that applied the steps, or restore the backup. Do not edit `uc_schema_history` by hand. On H2 and
MySQL, a step that failed is reported here too: this release can't retry it, so restore the backup
and fix the cause, then run the command on the restored database. On PostgreSQL, a failed step
leaves no history row, so the command runs it again.

`Step <n> left Unity Catalog index <index> missing on <table>: <hint>`
: On PostgreSQL and H2, index names are unique within a schema, so the step skipped Unity Catalog's
index because another object, such as another table's index, already has that name. The step is
recorded as applied, so renaming the other index and running the command again does not create
Unity Catalog's index.
Restore the backup (on a new install, drop the `uc_*` tables and `uc_schema_history`), rename the
other index or give Unity Catalog its own schema, then run the command again.

`Could not take the schema migration lock: <reason>`
: The command could not get the lock that keeps two migration runs apart, so it changed nothing.
Check that the database is reachable and that its user can run the lock call
(`pg_advisory_lock` on PostgreSQL, `GET_LOCK` on MySQL), then run the command again.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ nav:
- Deployment: server/deployment.md
- Deploy with Helm: server/helm.md
- Deploy for AWS: server/aws.md
- Upgrades: server/upgrades.md
- Observability: server/observability.md
- Integrations:
- Overview: integrations/index.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import io.unitycatalog.server.exception.BaseException;
import io.unitycatalog.server.exception.BaseExceptionHandler;
import io.unitycatalog.server.exception.ErrorCode;
import io.unitycatalog.server.migrate.SchemaMigrator;
import io.unitycatalog.server.observability.DbReadinessChecker;
import io.unitycatalog.server.observability.MetricsRegistries;
import io.unitycatalog.server.observability.UnityCatalogMetrics;
Expand Down Expand Up @@ -463,6 +464,11 @@ private void addSecurityDecorators(
public static void main(String[] args) {
OptionParser options = new OptionParser();
options.parse(args);
if (options.isUpgradeSchema()) {
Comment thread
shba24 marked this conversation as resolved.
Resolved
int exitCode = SchemaMigrator.runCommand(Path.of("etc", "conf"), System.out);
LogManager.shutdown();
System.exit(exitCode);
}
int port = options.getPort();
ServerProperties serverProperties = new ServerProperties(SERVER_PROPERTIES_FILE);
UnityCatalogServer.Builder serverBuilder =
Expand Down
Loading
Loading