schema
Plan, apply, and inspect schema migrations.
The schema subcommand owns schema evolution. schema plan reports what a
proposed .pg file would change without touching storage; schema apply
executes a supported migration; schema show prints the schema currently
accepted by the graph.
schema apply is the only subcommand that writes directly to the schema
catalog. It takes a per-branch schema-apply lock so a migration runs against
a stable snapshot.
schema plan
Diff a candidate schema against the graph's accepted schema and report the migration steps that would run.
Usage
omnigraph schema plan <path> --schema <pg> [options]Arguments
| Argument | Required | Description |
|---|---|---|
path | yes | Graph URI (local path or s3://); required unless resolved from --target / --config |
Options
| Option | Required | Default | Description |
|---|---|---|---|
--schema | yes | — | Path to the candidate .pg schema file |
--allow-data-loss | no | false | Render the plan as it would execute with destructive drops promoted to hard drops |
--target | no | — | Named graph from omnigraph.yaml |
--config | no | — | Path to an omnigraph.yaml |
--json | no | — | Output the plan as JSON |
Diagnostics emit stable codes (OG-DS-NNN, OG-MF-NNN). See
Schema Lint for the full reference.
Example
omnigraph schema plan ./graph.omni --schema ./next.pg --jsonschema apply
Apply a supported schema migration to the graph.
schema apply requires the graph to have only the main branch. All
other branches must be merged or deleted first. The command errors out
with "schema apply requires a graph with only main; found non-main
branches: <list>" if any other branch exists. Run omnigraph branch list
to see what's outstanding, merge or delete each, then retry.
Usage
omnigraph schema apply <path> --schema <pg> [options]Options
Same as schema plan, plus:
| Option | Required | Default | Description |
|---|---|---|---|
--allow-data-loss | no | false | Apply destructive drops as hard drops. Without this flag, drops are soft. The column or table is removed from the current manifest version but prior versions are retained until omnigraph cleanup runs, so --snapshot <pre_drop> can still read the dropped data. With this flag, cleanup_old_versions runs on affected datasets immediately and prior data becomes unreachable. |
Example
omnigraph schema apply ./graph.omni --schema ./next.pg --jsonschema show
Print the schema currently accepted by the graph.
Usage
omnigraph schema show <path> [options](omnigraph schema get is an accepted alias.)
Options
| Option | Required | Default | Description |
|---|---|---|---|
--target | no | — | Named graph from omnigraph.yaml |
--config | no | — | Path to an omnigraph.yaml |
--json | no | — | Output as JSON |