ForeignKeyActions
type ForeignKeyActions = "cascade" | "no action" | "restrict" | "set default" | "set null";
The possible actions the database engine has to take in case of deletion or update of the target record of the foreign key.
ForeignKeyOptions
interface ForeignKeyOptions {
onDelete?: ForeignKeyActions;
onUpdate?: ForeignKeyActions;
}
Specifies the options for a foreign key.
ForeignKeyOptions.onDelete
default:
"no action"
The action the database engine has to take in case of deletion of the target record of the foreign key. Accepts a ForeignKeyActions.
ForeignKeyOptions.onUpdate
default:
"no action"
The action the database engine has to take in case of update of the target filed of the foreign key. Accepts a ForeignKeyActions.