@rws-framework/db 4.1.3 → 4.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,7 +19,8 @@ function Relation(theModel, relationOptions = _DEFAULTS) {
19
19
  relationOptions.relationName :
20
20
  null
21
21
  };
22
- if (relationOptions.required) {
22
+ // Only set default cascade behavior if no explicit cascade was provided
23
+ if (relationOptions.required && !relationOptions.cascade) {
23
24
  if (!metaOpts.cascade) {
24
25
  metaOpts.cascade = {};
25
26
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rws-framework/db",
3
3
  "private": false,
4
- "version": "4.1.3",
4
+ "version": "4.1.4",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -43,7 +43,8 @@ function Relation(theModel: () => OpModelType<RWSModel<any>>, relationOptions: P
43
43
  null
44
44
  };
45
45
 
46
- if(relationOptions.required){
46
+ // Only set default cascade behavior if no explicit cascade was provided
47
+ if(relationOptions.required && !relationOptions.cascade){
47
48
  if(!metaOpts.cascade){
48
49
  metaOpts.cascade = {};
49
50
  }