Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
c70c490
[Build] Check the schema steps on every pull request
shba24 Nov 10, 2026
18be7a1
[Server] Retry a schema upgrade that stopped part way
shba24 Nov 10, 2026
5f1d6bd
[Server] Add a read-only --check-schema command
shba24 Nov 10, 2026
f4762df
[Build] Build the sample database instead of checking it in
shba24 Nov 10, 2026
76ea533
[Build] Tighten the schema step rules after review
shba24 Nov 11, 2026
5f3b96b
Merge stack/uc-upgrade-merge-checks into stack/uc-upgrade-retry
shba24 Nov 11, 2026
d19dab0
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 11, 2026
f0b9b09
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 11, 2026
6d7c5d1
[Build] Check effect files and fixed inputs through one column check
shba24 Nov 11, 2026
659f7f4
[Build] Simplify the enum member check and correct the index rule doc
shba24 Nov 11, 2026
1a875ec
Merge stack/uc-upgrade-merge-checks into stack/uc-upgrade-retry
shba24 Nov 11, 2026
b1d09e2
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 11, 2026
bdbbf0f
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 11, 2026
0159c18
[Build] Catch unbounded numeric and dropped MySQL defaults in the ste…
shba24 Nov 11, 2026
37ba0ad
[Build] Refuse a later-step index on a text column too long to index
shba24 Nov 12, 2026
2b18d4e
Merge stack/uc-upgrade-merge-checks into stack/uc-upgrade-retry
shba24 Nov 12, 2026
096c0f8
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 12, 2026
01a570b
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 12, 2026
779528a
[Build] Size the whole index key, and refuse types the rule can't bound
shba24 Nov 12, 2026
a4f5da3
[Build] Count the index entry's headers in the key-size rule
shba24 Nov 12, 2026
dca3713
Merge stack/uc-upgrade-merge-checks into stack/uc-upgrade-retry
shba24 Nov 12, 2026
295b989
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 12, 2026
f88b9a8
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 12, 2026
c1e1e27
[Build] Run the schema step checks in the all-tests rows
shba24 Nov 12, 2026
c77fd19
[Build] Close the index-size and enum gaps Yi found in the step rules
shba24 Nov 12, 2026
2684699
Merge stack/uc-upgrade-merge-checks into stack/uc-upgrade-retry
shba24 Nov 12, 2026
506b56e
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 12, 2026
c930d98
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 12, 2026
79620ca
[Build] Refuse a later-step partial index
shba24 Nov 12, 2026
2837e85
Merge stack/uc-upgrade-merge-checks into stack/uc-upgrade-retry
shba24 Nov 12, 2026
dd939b9
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 12, 2026
d4b1561
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 12, 2026
e33ad77
[Build] Let updateSchemaDumps write the effect files of several new s…
shba24 Nov 12, 2026
070da79
[Build] Read a PostgreSQL negative numeric scale as negative in the s…
shba24 Nov 12, 2026
487cf48
Merge stack/uc-upgrade-merge-checks into stack/uc-upgrade-retry
shba24 Nov 12, 2026
ff4e1bb
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 12, 2026
3ee4002
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 12, 2026
e1f8cac
[Build] Allow only literal defaults, and re-size an index whose colum…
shba24 Nov 12, 2026
8de2526
[Build] Say why the schema step check failed, and record steps with t…
shba24 Nov 12, 2026
2c07b04
Merge stack/uc-upgrade-merge-checks into stack/uc-upgrade-retry
shba24 Nov 12, 2026
d0f9c6e
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 12, 2026
b3709a3
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 12, 2026
431a23e
[Build] Re-size an index only when a column's type, size or scale cha…
shba24 Nov 12, 2026
6ca5ec6
Merge stack/uc-upgrade-merge-checks into stack/uc-upgrade-retry
shba24 Nov 12, 2026
78b3f48
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 12, 2026
bef45e7
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 12, 2026
a395b2c
[Build] Move the domain reviewer's Flyway line to its own PR
shba24 Nov 12, 2026
253a7b0
Merge stack/uc-upgrade-merge-checks into stack/uc-upgrade-retry
shba24 Nov 12, 2026
a9c120f
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 12, 2026
69874b3
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 12, 2026
dcfc013
Merge main before the #2113 squash into stack/uc-upgrade-retry
shba24 Nov 13, 2026
4059d0f
Record the #2113 squash merge (tree already contains it)
shba24 Nov 13, 2026
3ec321c
Merge main into stack/uc-upgrade-retry
shba24 Nov 13, 2026
3c49603
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 13, 2026
c86f8a1
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 13, 2026
6dc93e9
[Server] Keep another release's failed step, and resume an adoption s…
shba24 Nov 13, 2026
32cf83d
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 13, 2026
48ea430
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 13, 2026
063454d
[Server] Make --check-schema agree with the upgrade on a step recorde…
shba24 Nov 13, 2026
b704248
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 13, 2026
d4c1b00
[Server] Accept as a stopped first step only what its rerun completes
shba24 Nov 13, 2026
cebfbb7
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 13, 2026
410c789
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 13, 2026
0028bc2
[Server] Keep --check-schema from creating a missing H2 file for ever…
shba24 Nov 13, 2026
8d4c09b
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 13, 2026
727e167
[Build] Leave out what a killed sample database build leaves behind
shba24 Nov 13, 2026
7622c8e
Publish the sample database with a link, which never replaces a file
shba24 Nov 16, 2026
31bde32
Merge main into stack/uc-upgrade-retry
shba24 Nov 16, 2026
53daf8c
Refuse a step whose index or constraint name another application's ob…
shba24 Nov 16, 2026
57045cd
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 16, 2026
94ca03b
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 16, 2026
1e41dcd
Adopt a database without schema history at whichever step's schema it…
shba24 Nov 16, 2026
945a75c
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 16, 2026
4bd3bb0
Name the clashing object in the test, and list the refusal in the docs
shba24 Nov 16, 2026
0185546
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 16, 2026
68155f7
Check that an adoption at an earlier step records this release's step…
shba24 Nov 17, 2026
8e31ed9
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 17, 2026
d665a1a
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 17, 2026
6207460
Restore auto-commit on the migrator's connections, and say what the a…
shba24 Nov 17, 2026
298b728
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 17, 2026
10e4edb
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 17, 2026
e7cef8d
[Server] Keep the failed-record delete's own error when restoring aut…
shba24 Nov 18, 2026
c8dd68d
Merge stack/uc-upgrade-retry into stack/uc-upgrade-check-schema
shba24 Nov 18, 2026
25f21f5
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 18, 2026
8d4f0e4
Merge main into stack/uc-upgrade-check-schema
shba24 Nov 18, 2026
3748af0
[Server] Refuse a check-schema "allowed" that the upgrade would contr…
shba24 Nov 18, 2026
3b0d49a
[Server] Check every pending step's dropped constraints before any st…
shba24 Nov 18, 2026
f665105
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 18, 2026
c5961ba
[Server] Refuse H2 synonyms, PostgreSQL partitioned tables and types …
shba24 Nov 18, 2026
4e851cc
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 18, 2026
f08d290
[Server] Fix three gaps in --check-schema and --upgrade-schema
shba24 Nov 18, 2026
90e1cc5
Merge stack/uc-upgrade-check-schema into stack/uc-sample-database-built
shba24 Nov 18, 2026
0dd2dce
Merge main into stack/uc-sample-database-built
shba24 Nov 18, 2026
cc9f457
[Server] Build the sample database only where the server starts, and …
shba24 Nov 18, 2026
b227253
[Server] Keep the sample database test's log in its temp folder, and …
shba24 Nov 18, 2026
d386b60
[Server] Name the link failure's reason, end launcher option parsing …
shba24 Nov 18, 2026
2f976a2
[Server] Put the link failure's reason first, and cover the launcher'…
shba24 Nov 18, 2026
363f8a3
[Build] Check for an existing sample database in the tutorial test
shba24 Nov 18, 2026
cc027a8
[Build] Start the server when building the sample database fails
shba24 Nov 18, 2026
ce261ce
Launcher: decide a port value exactly like the option parser
shba24 Nov 18, 2026
775726d
Docs: state exactly when the launcher builds the sample database
shba24 Nov 18, 2026
5d14f45
Merge main into stack/uc-sample-database-built
shba24 Nov 19, 2026
d090d6d
Merge main into stack/uc-sample-database-built
shba24 Nov 19, 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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# The image builds its own sample database.
etc/db/h2db.*
etc/db/building-*
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
etc/db/h2db.mv.db
etc/db/h2db.trace.db
# What a killed sample database build leaves behind
etc/db/building-*
mlflow.db
target/

Expand Down
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Key points: HTTP verb annotations (`@Post`, `@Get`, `@Patch`, `@Delete`) with `@
| `connectors/spark/` | The Apache Spark connector (Scala). |
| `connectors/hadoop/` | The Hadoop connector. |
| `examples/cli/` | The `uc` command-line client. |
| `examples/sample-database/` | Builds the sample H2 database (`etc/db/h2db.mv.db`) that the quickstart examples use. |
| `integration-tests/` | Cross-module and end-to-end tests. |
| `ui/` | The web UI (React, built with Yarn / Node). |
| `docs/` | User documentation, published with MkDocs (`mkdocs.yml`). |
Expand All @@ -94,7 +95,7 @@ Key points: HTTP verb annotations (`@Post`, `@Get`, `@Patch`, `@Delete`) with `@

Server internal packages (`server/src/main/java/io/unitycatalog/server/`): `service/` (request handlers), `persist/` (repositories, DAOs, transactions), `auth/` (authorization), `security/` (authentication: JWT and security context), `delta/` (Delta integration), `exception/` (error types and handlers), `utils/` (config and shared helpers). Tests mirror this under `server/src/test/...`, with `base/` holding the shared test base classes (`BaseServerTest`, `BaseCRUDTest`) and per-domain extensions.

sbt projects: `server`, `serverShaded`, `client`, `pythonClient`, `controlApi`, generated model projects (`serverModels`, `controlModels`), `apiDocs`, `cli`, `spark`, `hadoop`, `integrationTests`, and the aggregate `root`.
sbt projects: `server`, `serverShaded`, `client`, `pythonClient`, `controlApi`, generated model projects (`serverModels`, `controlModels`), `apiDocs`, `cli`, `sampleDatabase`, `spark`, `hadoop`, `integrationTests`, and the aggregate `root`.

## Domain and authorization model

Expand Down
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ WORKDIR $HOME

COPY --parents dev/ build/ project/ examples/ server/ api/ clients/ version.sbt build.sbt ./

# Only the server and the CLI ship in the image. The root `package` would also
# resolve Spark, Delta, and Hadoop for the connectors.
RUN apk add --no-cache bash && ./build/sbt -info clean server/package cli/package
# Only the server, the CLI, and the sample database ship in the image. The root `package`
# would also resolve Spark, Delta, and Hadoop for the connectors. The sample database is built
# here, never taken from the build context: etc/ is not copied into this stage, so a change in
# it does not rebuild this layer.
RUN apk add --no-cache bash && ./build/sbt -info clean server/package cli/package sampleDatabase/buildSampleDatabase

# Stage only what the launchers load, at its build path, because the classpath
# files hold absolute paths: the classpath files, their entries, and the source
Expand Down Expand Up @@ -93,8 +95,10 @@ COPY --from=base --chown=$USER:$USER --chmod=550 /staging$HOME/ $HOME/
USER $USER

# Copy remaining directories here for caching optimization. The server writes
# its database, data, and logs under etc/.
# its database, data, and logs under etc/. .dockerignore keeps the context's
# sample database out, so the one below is the built one.
COPY --chown=$USER:$USER --parents bin/ etc/ $HOME/
COPY --from=base --chown=$USER:$USER $HOME/etc/db/h2db.mv.db $HOME/etc/db/h2db.mv.db

# COPY creates $HOME with mode 755 and gives etc/ and etc/conf the modes of the
# build context. Set these three directories, not their contents, so their modes
Expand Down
70 changes: 70 additions & 0 deletions bin/start-uc-server
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ROOT_DIR="$(dirname "$SCRIPT_DIR")"

TARBALL_JAR_DIR="$ROOT_DIR/jars"
SERVER_CLASS_FILE="$ROOT_DIR/server/src/main/java/io/unitycatalog/server/UnityCatalogServer.java"
SAMPLE_DATABASE="$ROOT_DIR/etc/db/h2db.mv.db"

# This function generates the unity catalog jars using sbt
generate_jar() {
Expand All @@ -13,6 +14,67 @@ generate_jar() {
$GENERATE_JAR_COMMAND || exit
}

# This function builds the quickstart's sample database (etc/db/h2db.mv.db) using sbt. A source
# checkout does not hold it; the tarball and the Docker image ship one.
build_sample_database() {
local BUILD_SAMPLE_DATABASE_COMMAND="$ROOT_DIR/build/sbt -info buildSampleDatabase"
echo "Running SBT to build the sample database $SAMPLE_DATABASE: $BUILD_SAMPLE_DATABASE_COMMAND"
if ! $BUILD_SAMPLE_DATABASE_COMMAND; then
Comment thread
shba24 marked this conversation as resolved.
Resolved
echo "Could not build the sample database $SAMPLE_DATABASE; starting the server anyway." >&2
fi
}

# This function succeeds when its argument is a number the option parser takes as a port value: an
# optional + or -, then digits, within the range of an int.
is_port_number() {
local digits=${1#[+-]} limit=2147483647
[ -n "$digits" ] && [ -z "${digits//[0-9]/}" ] || return 1
[ "${1:0:1}" = "-" ] && limit=2147483648
digits=${digits#"${digits%%[!0]*}"}
[ "${#digits}" -le 10 ] && (( 10#${digits:-0} <= limit ))
}

# This function succeeds when the command line starts the server: it holds nothing but the port
# options (one or two dashes, the start of the name, the value after a space, an = or, for -p, right
# after it) and words that are not options. A port value is a number the option parser takes. A --
# ends the options: the words after it are not options. A schema command, --version, --help or an
# unknown option does not start it.
starts_server() {
local arg long name
while [ $# -gt 0 ]; do
arg=$1
shift
case "$arg" in
--) return 0 ;;
-) continue ;;
-*) ;;
*) continue ;;
esac
long=${arg#--}
name=${long#-}
name=${name%%=*}
# A single dash takes a one-letter option only as -p.
if [ "$long" = "$arg" ] && [ "${#name}" -lt 2 ] && [ "$name" != p ]; then
return 1
fi
if [[ port == "$name"* || obs-port == "$name"* ]]; then
case "$arg" in
*=*) is_port_number "${arg#*=}" || return 1 ;;
*)
# The value is the next word.
[ $# -ge 1 ] && is_port_number "$1" || return 1
shift
;;
esac
elif [ "$long" = "$arg" ] && [ "${name:0:1}" = p ] && [[ "$arg" != *=* ]]; then
# -p with its value right after it.
is_port_number "${name:1}" || return 1
else
return 1
fi
done
}

# This function starts the unity catalog server. exec makes the JVM this process, so it receives
# SIGTERM itself (as PID 1 in a container) and drains before exiting. The server stops Log4j after
# that drain, so Log4j's own shutdown hook, which would stop logging during it, is off.
Expand All @@ -38,6 +100,14 @@ run_in_source_code() {
generate_jar
fi

# The Docker image holds the server's sources but not build/sbt: it ships its sample database,
# and a volume mounted over etc/db stays empty.
# Only a command line that starts the server uses the sample database.
if [ ! -f "$SAMPLE_DATABASE" ] && [ -x "$ROOT_DIR/build/sbt" ] && starts_server "$@"; then
echo "Sample database '$SAMPLE_DATABASE' not found."
build_sample_database
fi

run_uc_server_java_command "$SERVER_CLASSPATH_FILE" "$@"
}

Expand Down
42 changes: 35 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,9 @@ lazy val apiDocs = (project in file("api"))
}
)

// Define the custom task key
lazy val populateTestDB = taskKey[Unit]("Run PopulateTestDatabase main class from the test folder")
// Builds the quickstart's sample database etc/db/h2db.mv.db (SampleDatabase, in the sampleDatabase
// project), keeping a file that exists.
lazy val buildSampleDatabase = taskKey[Unit]("Build the sample database etc/db/h2db.mv.db")

lazy val server = (project in file("server"))
.dependsOn(client % "test->test")
Expand Down Expand Up @@ -558,10 +559,6 @@ lazy val server = (project in file("server"))
|""".stripMargin)
Seq(file)
},
populateTestDB := {
val log = streams.value.log
(Test / runMain).toTask(s" io.unitycatalog.server.utils.PopulateTestDatabase").value
},
Test / javaOptions += s"-Duser.dir=${(ThisBuild / baseDirectory).value.getAbsolutePath}",
// Include server and control models in the bin package for server
// This will allow us to have a single maven artifact and not multiple (server, server models, control models)
Expand Down Expand Up @@ -692,6 +689,37 @@ lazy val cli = (project in file("examples") / "cli")
Test / forkOptions := (Test / forkOptions).value.withWorkingDirectory((ThisBuild / baseDirectory).value),
)

// Builds the quickstart's sample database with the server's schema steps and repositories. A
// project of its own, so that neither the server jar nor the server's test classes hold it.
lazy val sampleDatabase = (project in file("examples") / "sample-database")
.dependsOn(server)
.dependsOn(serverModels)
.dependsOn(controlModels)
.enablePlugins(CheckstylePlugin)
.settings(
name := s"$artifactNamePrefix-sample-database",
commonSettings,
log4jProcessSettings,
skipReleaseSettings,
javafmtCheckSettings(),
javaCheckstyleSettings("dev/checkstyle-config.xml"),
Compile / compile / javacOptions ++= javacRelease17,
libraryDependencies ++= Seq(
"org.junit.jupiter" % "junit-jupiter" % junitJupiterVersion % Test,
"org.junit.platform" % "junit-platform-launcher" % junitPlatformVersion % Test,
"net.aichler" % "jupiter-interface" % JupiterKeys.jupiterVersion.value % Test,
"org.assertj" % "assertj-core" % "3.26.3" % Test,
),
buildSampleDatabase := Def.taskDyn {
val file = (ThisBuild / baseDirectory).value / "etc" / "db" / "h2db.mv.db"
if (file.exists) {
Def.task { streams.value.log.info(s"$file already exists; keeping it") }
} else {
(Compile / runMain).toTask(" io.unitycatalog.server.utils.SampleDatabase \"" + file + "\"")
}
}.value,
)

// What the test-database harness needs to run on PostgreSQL: server, and spark and hadoop, which take
// the harness from server-shaded.
lazy val testDatabaseDependencies = Seq(
Expand Down Expand Up @@ -924,7 +952,7 @@ lazy val integrationTests = (project in file("integration-tests"))
)

lazy val root = (project in file("."))
.aggregate(serverModels, client, pythonClient, server, cli, spark, hadoop, controlApi, controlModels, apiDocs)
.aggregate(serverModels, client, pythonClient, server, cli, sampleDatabase, spark, hadoop, controlApi, controlModels, apiDocs)
.settings(
name := s"$artifactNamePrefix",
createTarballSettings(),
Expand Down
6 changes: 6 additions & 0 deletions clients/python/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ cd "${SCRIPT_DIR}/../.." || exit 1
# Generate the client library
build/sbt pythonClient/generate

# Build the sample database the tests read, which bin/start-uc-server would otherwise build while
# the tests wait for the server
if [ ! -f etc/db/h2db.mv.db ]; then
build/sbt buildSampleDatabase || exit 1
fi

# Sync all pinned test dependencies from the lock file
cd "${SCRIPT_DIR}"
uv sync --frozen
Expand Down
14 changes: 11 additions & 3 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,21 @@ OpenJDK Runtime Environment Homebrew (build 17.0.12+0)
OpenJDK 64-Bit Server VM Homebrew (build 17.0.12+0, mixed mode, sharing)
```

From the repository root, build the server artifacts. The startup script can trigger this automatically on first run,
but building explicitly is recommended:
From the repository root, build the server artifacts and the sample database (`etc/db/h2db.mv.db`) that the examples
below use. The startup script builds whichever is missing on first run, but building explicitly is recommended:

```sh
build/sbt package
build/sbt package buildSampleDatabase
Comment thread
shba24 marked this conversation as resolved.
Resolved
```

The sample database is a local file that the server changes as you use it. Building it keeps an existing
`etc/db/h2db.mv.db`, and the folder it is in must be on a file system that supports hard links. To reset it to the
sample data, stop the server, move `etc/db/h2db.mv.db` aside and run `build/sbt buildSampleDatabase` again (starting
the server with `bin/start-uc-server` builds it too). In a source checkout (where `build/sbt` is present and executable) the launcher builds `etc/db/h2db.mv.db` when it is missing and the command line starts the server, whatever database the configuration uses, and starts the server even when that build fails. The file is no longer part of the repository, so `git checkout`
does not restore it. If you changed the sample database in a checkout from before it was built, copy
`etc/db/h2db.mv.db` somewhere safe before you update the checkout: git deletes the file, or refuses to update while
it has local changes.

From the repository root, run `bin/start-uc-server` to instantiate the server. Here is what you
should see:

Expand Down
1 change: 1 addition & 0 deletions docs/server/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ To deploy on Kubernetes, see [Deploy with Helm](helm.md).
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)).
In a source checkout (where `build/sbt` is present and executable) the launcher builds `etc/db/h2db.mv.db` when it is missing and the command line starts the server, whatever database the configuration uses, and starts the server even when that build fails.
Comment thread
shba24 marked this conversation as resolved.
Resolved

### Configuring the database

Expand Down
Binary file removed etc/db/h2db.mv.db
Binary file not shown.
Loading
Loading