arcflow migrate up
Apply embedded PostgreSQL schema migrations shipped in runtime/arcflow-core/migrations/. Required before arcflow-server can serve POST /v1/runs on a fresh database.
Usage
Subcommand structure:
(No additional flags today.)
Expected output
Success:
Failure examples:
Exit codes
| Code | Meaning |
|---|---|
| 0 | All pending migrations applied |
| 1 | Connect or migration SQL error |
| 2 | Missing ARCFLOW_POSTGRESQL_URL |
Idempotent behavior
Migrations use IF NOT EXISTS and version tracking inside arcflow_core::migrate::run. Re-running migrate up on an up-to-date database succeeds without changes.
Seven migrations
| Version | Creates / alters |
|---|---|
| 000001 | arcflow_recovery_state |
| 000002 | Graph columns on recovery |
| 000003 | arcflow_runs |
| 000004 | arcflow_human_approvals, run snapshots |
| 000005 | arcflow_trace_events |
| 000006 | arcflow_workflows, arcflow_workflow_aliases |
| 000007 | arcflow_sites, tokens, usage daily |
Table detail: server/postgres-schema.md.
Deploy runbook
Option A: CLI before server rollout
Option B: Docker Compose init container
docker/docker-compose.server.yml runs arcflow-migrate once Postgres is healthy, then starts the server.
When to prefer manual migrate
- Blue/green deploys where DB migrates in a separate job
- CI gates that fail deploy if schema drift detected
- Managed Postgres where init containers are not used
Verify after migrate
Expect 200. 503 indicates connection failure or pending migrations.