Phalcon migration down() rollback after schema change
0 reputation · 07 Feb 2023, 12:06 UTC
Phalcon's migration down() method is intended to reverse the DDL statements applied in up(), but it assumes the database remains in the exact state described by the migration history.
The goal is to make rollback safe after a later schema change has already altered the objects that an earlier down() references. Current behavior offers no built‑in constraint to verify that the live schema matches the migration's expectations, and engine‑level DDL commits may cause partial rollbacks. How can Phalcon enforce schema compatibility before executing down()? Can a pre‑flight check detect drift and abort the rollback? Is there a documented way to select a target version and unwind all later migrations safely?