@postxl/generator 0.29.0 → 0.30.0

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.
@@ -82,6 +82,9 @@ function parseModel({ dmmfModel, enums, models, config, }) {
82
82
  if (!referencedModel) {
83
83
  (0, error_1.throwError)(`Investigate: Field references unknown model ${dmmfField.type}.`);
84
84
  }
85
+ if (dmmfField.relationOnDelete && dmmfField.relationOnDelete !== 'NoAction') {
86
+ (0, error_1.throwError)(`Investigate: "onDelete" attribute for relationship ${dmmfField.relationName} must be "NoAction": any deletes must be handled in the application layer, e.g. to update repository and search caches!`);
87
+ }
85
88
  relations[dmmfField.relationFromFields[0]] = referencedModel;
86
89
  }
87
90
  const relationFields = dmmfModel.fields
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postxl/generator",
3
- "version": "0.29.0",
3
+ "version": "0.30.0",
4
4
  "main": "./dist/generator.js",
5
5
  "typings": "./dist/generator.d.ts",
6
6
  "bin": {
@@ -46,7 +46,7 @@
46
46
  "build": "tsc -p tsconfig.build.json",
47
47
  "prepublish": "tsc -p tsconfig.build.json",
48
48
  "dev": "tsc -p tsconfig.build.json -w",
49
- "test:generation": "./scripts/test.sh",
49
+ "test:generators": "./scripts/test.sh",
50
50
  "test:jest": "jest",
51
51
  "test:watch": "jest --watch",
52
52
  "test:types": "tsc --noEmit"