Repository navigation
docs(handbooks): belongsTo states ownership, not a delete behaviour - #201
Merged
Merged
Conversation
The handbooks said a `belongsTo` foreign key cascades. Generator 0.24.0 makes a soft-delete parent's foreign keys `NoAction`, and a child with two parents was already `NoAction`, so `OnDelete` no longer tells owned from not owned. A consumer that read ownership from it got `403`s after regenerating. State the rule as measured on the 0.24.0 jar, tell readers to take ownership from `belongsTo`, and record the change in the generator release notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The handbooks said a
belongsToforeign key cascades on delete. That is no longer true at the pinned generator: clabonte/generator#3103 (0.24.0) makes a soft-delete parent's foreign keysNoAction. One consumer's tenant check read ownership fromOnDelete, and after regenerating, non-admin users got403on rows with no tenant column of their own.Changes
API_Handbook.md:belongsTostates ownership. New paragraph gives the rule and says never to infer ownership fromOnDelete.Vendor_Extensions.md:x-referencesandx-fk-forno longer promise Cascade.docs/generator-releases.md: records the change under 0.24.0, whose notes missed it.Verification
Generated
entityTypeConfigurationfromhello-orders, changing onlyOrder'sdeletemode:OrderdeclaresOrderLineFK, 0.24.0OrderLineFK, 0.23.0delete: softNoActionCascadedelete: hardCascadeCascadeOrder, with two parents, isNoActionon its owning foreign keys in every run.The mutual-parent condition comes from reading
RelationshipSide.computeDeleteBehaviorin a generator checkout, not from a jar run. The403account is the consumer's report; I did not reproduce it.check-shipped-docs.pypasses.The handoff's second request, flagging
OnDeletechanges as breaking in generator release notes, is for the generator and is not done here.No version bump; that belongs to the release.
🤖 Generated with Claude Code