Repository navigation
v2.20.0
·
18 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Changed
- A cycle of
CASCADEkeys through several tables is enforced (#85, ADR 0041). It was refused while the cascade was anON UPDATErule, which PostgreSQL rewrites into itself; since 2.19.0 it is an arm of the owner's trigger, and an arm stops at_deleted_at IS NULL. Every project that declared one gets the arms: one archive stamps the whole loop it reaches, and a restore matches that stamp, so it travels up the loop too. A joined key into its own MTI root is enforced as well.soft_delete()and the.delete()fast path no longer decline a cycle edge. A cycle holding an owned key is still refused, with a note that no longer cites rule recursion.CascadeKind.CYCLEis gone andclassify_cascadetakes nocycle_edges. Existing projects:makemigrations(ormakeguitarmigrations) writes a migration for each app hosting a cycle key, which replaces the owner'ssoft_delete_cascade_on_*trigger with one carrying the arms. - A self-referential
CASCADEkey is an arm of the owner's trigger (#85, ADR 0042). It took a trigger of its own since 2.8.0, which stampedNOW()and never revived. It now carries the parent's_deleted_atand a restore revives the subtree archived with it; a child archived earlier keeps its own stamp. The primary-key-rewrite refusal is the union of the two (wider than the old trigger's for a statement that re-keys an archived row and also touches a live sibling with children), and a$$in a name no longer refuses the key.makemigrationswrites, for each app hosting a self key, a migration that replaces the owner's trigger and retires the self one, whose reverse rebuilds it (the owner's trigger, re-emitted, reverses to aDROPas every re-emission does). Existing projects:DROP TRIGGERtakes ACCESS EXCLUSIVE on those tables until the migration commits, so setlock_timeout. Dropping a self key's column now fails an archive or a restore of the table until re-generated, not everyUPDATE.