ORM-18: Add relationship test fixtures (Profile, Post, Tag) #18
Labels
No labels
area:core
area:database
area:migrations
area:model
area:relations
area:schema
area:tests
breaking-change
size:M
size:S
tracking
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
NoctisWolfshadow/tessera-orm#18
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Depends on: #17
Context
Every relation issue needs the same test models and schema: 1-1 (
Userhas oneProfile), 1-n (Userhas manyPosts) and n-m (Posthas manyTags through a pivot table). Building them once, with real foreign keys, also proves that FK enforcement (#5) and cascades work.Tasks
Profile,PostandTagintests/common, each with aModelStatefield and typedColumnconsts (Post::USER_ID,Profile::USER_ID, ...).ON DELETE CASCADEon every foreign key.Example
Acceptance criteria
user_idfails with a foreign-key error.UNIQUE.HasManyandHasOne#19BelongsTo#20BelongsToMany(read side) #21