mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
docs: update relations.md (#5456)
This commit is contained in:
parent
ede779d9af
commit
05cad88718
@ -21,7 +21,7 @@ There are several types of relations:
|
||||
There are several options you can specify for relations:
|
||||
|
||||
* `eager: boolean` - If set to true, the relation will always be loaded with the main entity when using `find*` methods or `QueryBuilder` on this entity
|
||||
* `cascade: boolean | ("insert" | "update" | "remove")[]` - If set to true, the related object will be inserted and updated in the database. You can also specify an array of [cascade options](#cascade-options).
|
||||
* `cascade: boolean | ("insert" | "update")[]` - If set to true, the related object will be inserted and updated in the database. You can also specify an array of [cascade options](#cascade-options).
|
||||
* `onDelete: "RESTRICT"|"CASCADE"|"SET NULL"` - specifies how foreign key should behave when referenced object is deleted
|
||||
* `primary: boolean` - Indicates whether this relation's column will be a primary column or not.
|
||||
* `nullable: boolean` - Indicates whether this relation's column is nullable or not. By default it is nullable.
|
||||
@ -96,7 +96,7 @@ Also, they provide a less explicit way of saving new objects into the database.
|
||||
|
||||
### Cascade Options
|
||||
|
||||
The `cascade` option can be set as a `boolean` or an array of cascade options `("insert", "update", "remove")[]`.
|
||||
The `cascade` option can be set as a `boolean` or an array of cascade options `("insert", "update")[]`.
|
||||
|
||||
It will default to `false`, meaning no cascades. Setting `cascade: true` will enable full cascades. You can also specify options by providing an array.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user