-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Adding on to #53 ...
For foreign keys there are a number of options a foreign key may have, but from a definition standpoint adding the foreign key to the column definition make the most sense as each column may only reference a single foreign column.
What I propose is the following:
{
username: {
type: DataTypes.STRING,
unique: "some-arbitrary-key",
},
session: {
type: DataTypes.STRING,
foreignKey: {
table: "session-table", // example like Model.tableName
column: "session-table-field-name", // example like Model.columnName
onDelete?: {
cascade?: boolean,
restrict?: boolean,
setNull?: boolean,
setDefault?: boolean,
},
onUpdate?: {
cascade?: boolean,
restrict?: boolean,
setNull?: boolean,
setDefault?: boolean,
},
},
},
}
I think this approach is fairly straight-forward and easy to follow.
Thoughts?
sunnhyn
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request