-
Notifications
You must be signed in to change notification settings - Fork 301
Milestone
Description
Currently, the OnCascade functionality only works on explicit foreign keys.
User
name String
Primary name
Post
user UserId
Foreign User OnDeleteCascade fkuser user
We should also be able to write:
User
name String
Primary name
Post
user UserId OnDeleteCascade
Problem surfaced in #1113
To implement this, we'll need to start with takeCols to parse the OnDeleteand OnUpdate behavior into the column type. However, we don't currently track whether or not this field is a reference yet, so we'll need to figure some other way to propagate the cascade behavior.
- How should we handle cascade behavior on non-foreign key fields? ie:
Easiest thing to do is ignore it silently. But throwing an
User name String OnDeleteCascadeerrormay work as well. - We will probably need to update
FieldDefto accept the cascade behavior separately from the reference. Then, infixForeignkeys, we'll copy that into the new reference.
Metadata
Metadata
Assignees
Labels
No labels