dpg apply
dpg apply
Execute the planned migration and update the snapshot
Synopsis
Runs dpg plan, prompts for approval, executes the SQL against the primary node, and updates the committed snapshot on success.
Destructive operations are blocked unless –allow-destructive is set. Partition strategy changes additionally require –approve-partition-rebuild.
With –dry-run, the migration is computed and printed but never executed. With –no-snapshot, the snapshot is not updated after a successful apply. With –strict, lint warnings are promoted to errors and block the apply.
dpg apply [flags]
Options
--allow-destructive allow destructive operations
--approve-partition-rebuild allow partition strategy rebuild (implies --allow-destructive for partition ops)
--cluster string cluster to apply (required when multiple clusters exist)
--database string database to apply (required when multiple databases exist)
--dry-run print the migration plan but do not execute or update the snapshot
-h, --help help for apply
--no-snapshot skip snapshot update after a successful apply
--strict treat lint warnings as errors (blocks apply if any exist)
-y, --yes skip interactive approval prompt
Options inherited from parent commands
-C, --dir string project root directory (default: current working directory)
--env string path to .env file (default: .env in project root, if present)
SEE ALSO
- dpg - Declarative PG — schema compiler and migration tool