Skip to content
Corex

TableMigrationRunner

Corex\Config\DataModels\TableMigrationRunner · interface · Config layer

The schema-changing boundary for a managed table’s declared migrations (spec 074, FR-3.6). Snapshot-then-swap rather than snapshot-then-replay: the snapshot is a real copy of the table as it was, and rolling back puts that copy back in place. That restores the schema and the rows, which a replayed “down” script generally cannot promise — and it is why the rollback claim in the interface is one CoreX can actually keep.

Copy the table as it stands and return the snapshot’s identifier.

runPlan(string $table, array $statements): int

Section titled “runPlan(string $table, array $statements): int”

Run a declared plan against the table. Statements use {table} where the real, prefixed table name belongs; the implementation substitutes it, so a declaration never has to know the site’s table prefix.

restore(string $table, string $snapshot): bool

Section titled “restore(string $table, string $snapshot): bool”

Put a snapshot back in place of the table, schema and rows together.

Drop a snapshot that is no longer needed.