docs: update relations.md (#5456)

This commit is contained in:
Seunghwan Oh 2020-02-17 22:11:43 +09:00 committed by GitHub
parent ede779d9af
commit 05cad88718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.