Omnigraph
CLI

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

ArgumentRequiredDescription
pathyesGraph URI (local path or s3://); required unless resolved from --target / --config

Options

OptionRequiredDefaultDescription
--schemayesPath to the candidate .pg schema file
--allow-data-lossnofalseRender the plan as it would execute with destructive drops promoted to hard drops
--targetnoNamed graph from omnigraph.yaml
--confignoPath to an omnigraph.yaml
--jsonnoOutput 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 --json

schema 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:

OptionRequiredDefaultDescription
--allow-data-lossnofalseApply 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 --json

schema show

Print the schema currently accepted by the graph.

Usage

omnigraph schema show <path> [options]

(omnigraph schema get is an accepted alias.)

Options

OptionRequiredDefaultDescription
--targetnoNamed graph from omnigraph.yaml
--confignoPath to an omnigraph.yaml
--jsonnoOutput as JSON

On this page