Skip to content

Table Partitions ​

Migrata handles basic PostgreSQL partition operations automatically, while complex changes that involve data movement are detected and flagged for manual handling.

What Is Automated ​

Basic DDL operations on partitions are handled the same as regular tables:

  • Creating a new partition table
  • Dropping an existing partition table
  • Renaming a partition table

These are safe schema-only operations that don't require moving data.

What Requires Manual Handling ​

Changes that would move or restructure data are outside the CLI's scope. The diff engine detects these but flags them for manual review:

ChangeWhy Manual
Partition BoundsChanging the value range or list of values requires detaching and migrating data to a new partition
Partition StrategySwitching between RANGE, LIST, or HASH requires rebuilding the partition structure
Partition ParentMoving a partition to a different parent table requires detaching and reattaching with data intact

Each detected change displays a warning label in the plan output:

~ | CHANGE PARTITION BOUNDS |    Manual intervention required
~ | CHANGE PARTITION STRATEGY |  Manual intervention required
~ | CHANGE PARTITION TARGET |    Manual intervention required

Schema Overview ​

The Schema Overview table includes a Partitions column that shows the partition count for both source and target schemas. Changes are highlighted so you can see at a glance whether partitions are being added, removed, or modified.

Dependency Tracking ​

Partition tables are registered as depending on their parent table in the dependency graph. A change to a parent table will flag its child partitions as potentially impacted components.