dpg log rebase

dpg log rebase

Resolve two migrations after the same one (a merge of two branches)

Synopsis

When two branches each recorded a migration, the merged log has two migrations after the same one (DPG-E047). rebase keeps the chain ending at –keep (the target branch’s last migration), removes the other branch’s migrations, rewrites the snapshot from the kept chain, and records the source’s change again on top of it.

A database that ran a removed migration has no point in the log any more and must be rebuilt.

dpg log rebase --keep <migration> [flags]

Options

      --allow-destructive           allow the re-recorded migration to have destructive operations
      --approve-partition-rebuild   allow the re-recorded migration a manual partition strategy rebuild
      --cluster string              cluster (required when multiple clusters exist)
      --database string             database (required when multiple databases exist)
  -h, --help                        help for rebase
      --keep string                 the last migration of the chain to keep

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 log - Repair and rebase the migration log
Auto generated by spf13/cobra on 12-Oct-2026