Skip to content

v2.17.0

Choose a tag to compare

@github-actions github-actions released this 08 Oct 08:55
· 50 commits to main since this release
Immutable release. Only release title and notes can be modified.
da67221

Added

  • guitars.E005 refuses an MTI child that declares a primary key of its own beside its parent link (#64, ADR 0034). Every join the kit writes from such a child up to an ancestor holding a kit column or tenant dimension read its key as that link: a DELETE of the child archived an unrelated ancestor row, the parent _updated_at trigger and owned arms touched or matched one, and a tenant policy's owner join matched another tenant's row. manage.py check and migrate now stop on it, with a hint: drop the explicit key, or make the model its own with a foreign key to its parent. The generator re-asks the question for a project that skips checks, and writes no MTI redirect rule, parent trigger, owned arm, owner-join policy or cascade rule into such a model, naming E005 in a note except for the owned arm, which is dropped quietly; hard_delete(), which runs no check, raises ImproperlyConfigured for it, for its whole tree in the queryset form and for any such child the instance walk reaches, where it removed an unrelated ancestor row. A tenanted model with no kit column is covered too. A child holding its own column or tenant dimension is not: it joins nothing.

Fixed

  • A CASCADE key through to_field matched on the owner's primary key (#59, ADR 0035). With an integer column the rule archived the wrong rows (a seat holding number 2 matched the ticket whose pk was 2); with a char column CREATE RULE compared varchar with bigint and migrate failed. The cascade rule, its revive arm and the self-cascade trigger now match children on the to_field column, pairing a row across a statement on the pk. A key into the primary key renders as it did: nothing re-emits for it. A column declared on a descendant, below the table holding _deleted_at, is a column the rule cannot read, and is refused with a note instead.
  • soft_delete() and the .delete() fast path take a to_field key now: it was a refusal, and a decline, while the rule matched the wrong rows.

Changed

  • Upgrade step. A project with a to_field cascade key regenerates one enforcement migration (makemigrations); --check is red until it does. A project with the E005 shape cannot start until it restructures the model.