CLI: managing the database schema
VersionGate’s database schema is applied and inspected with the
versiongate CLI’s migrate subcommands — never automatically by the
server binary (see Installation). This
assumes the CLI is already installed and pointed at your database; see
CLI bootstrap if you haven’t done that yet.
export VERSIONGATE_DATABASE_DSN="postgres://versiongate:versiongate@localhost:5432/versiongate?sslmode=disable"versiongate migrate up
Section titled “versiongate migrate up”Applies all pending migrations.
versiongate migrate up# migrations appliedSafe to run any number of times: if every migration is already applied, it’s a no-op, not an error.
versiongate migrate status
Section titled “versiongate migrate status”Shows every known migration and whether it’s been applied.
versiongate migrate status# 00001_create_core_schema.sql pendingAfter migrate up, the same command shows when it was applied:
versiongate migrate status# 00001_create_core_schema.sql applied at 2026-01-01 00:00:00 +0000 UTCversiongate migrate down
Section titled “versiongate migrate down”Rolls back only the single most recently applied migration — not every migration, and not to a specific version.
versiongate migrate down# last migration rolled backRunning migrate status afterward shows that migration as pending
again.
Current schema
Section titled “Current schema”There is currently one migration
(00001_create_core_schema.sql),
covering Projects, Applications, Releases, and API Tokens. As the schema
evolves, new migration files are added — migrate up always applies
whatever is pending, so the commands above don’t change as that happens.