Setyenv · Docs
  • English
  • Spanish
  • Chinese
  • Japanese
  • Arabic
  • German
  • French
  • Hindi
  • Indonesian
  • Italian
  • Dutch
  • Portuguese
  • Russian
  • Turkish

Reconciler

The Reconciler is the component that keeps the database schema aligned with the entity definitions you authored. Every time you add a field, change a type, rename a field, or delete an entity, the Reconciler computes the diff and runs the appropriate DDL (ALTER TABLE, CREATE TABLE, etc.).

Dry-run first

The Reconciler ALWAYS runs in dry-run mode by default when you save a schema change. It produces:

  • A list of operations it would perform.
  • For each operation, an estimate of how many rows it would affect.
  • A "danger level" flag (safe, caution, destructive).

Destructive operations (dropping a column, renaming a slug) require you to click Apply explicitly. Safe operations (adding a nullable column) auto-apply.

Why a Reconciler instead of "just run the SQL"

  1. Idempotency. If a previous reconcile crashed halfway, the next run picks up where it left off. The Reconciler tracks state in wp_pfm_reconcile_log.
  2. Batching. A ALTER TABLE that adds an index on 5M rows is broken into chunks so the request doesn't timeout. The Reconciler can resume across multiple HTTP requests via WP-Cron.
  3. Foreign-key protection. Deleting an entity that has relations pointing at it is blocked. The error names the referring entities.
  4. Reversibility. Most operations have a recorded inverse that the Reconciler can apply if you click Undo within a short undo window.

Where to see it

PF Manage → Reconciler lists every pending and recent operation. You can drill into any operation to see the exact SQL, the rows affected, the duration, and the user who approved it.