Appearance
Run database migrations
This applies the plexsphere core schema and the SpiceDB bootstrap against a local Postgres 16 container. It is not a plexctl operation — migrations run through make migrate and the goose CLI. It mirrors what CI runs against its testcontainers.
Prerequisites
- Docker (or a compatible runtime) reachable from the shell.
- Either the goose CLI on
$PATH, or the in-repo runnermake migrateinvokes. DATABASE_URLexported to the target DSN. A missing value aborts with exit64.
Steps
Start Postgres and point DATABASE_URL at it
bash
docker run --name plexsphere-pg -e POSTGRES_PASSWORD=pg -e POSTGRES_DB=plexsphere -p 5432:5432 -d postgres:16Then export DATABASE_URL=postgres://postgres:pg@localhost:5432/plexsphere?sslmode=disable.
Apply the core schema
make migrate drives the embedded goose runner; it is idempotent, so re-running is a safe no-op.
bash
make migrateCreate the spicedb database and apply its bootstrap
The SpiceDB bootstrap must target a superuser DSN pointed at the spicedb database, not the core one.
bash
docker run --rm --network=host -e PGPASSWORD=pg postgres:16 createdb -h localhost -U postgres spicedbbash
goose -dir internal/platform/db/spicedb postgres "postgres://postgres:pg@localhost:5432/spicedb?sslmode=disable" uptools/migrate --target=spicedb is an equivalent path if goose is not installed. Rollbacks (down) are destructive and require --confirm-destructive.
Verification
bash
docker run --rm --network=host -e PGPASSWORD=pg postgres:16 psql -h localhost -U postgres -d plexsphere -c "SELECT service, version FROM plexsphere._platform_version;"A populated _platform_version row plus a spicedb.goose_db_version row in the spicedb database means both migrations landed.
See also
../../reference/platform/db.md— the migration API and sqlc workflow.../../architecture/storage-topology.md— core vs. SpiceDB topology.