oradm-to-gql 34.0.0 → 34.1.0-rc

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oradm-to-gql",
3
- "version": "34.0.0",
3
+ "version": "34.1.0-rc",
4
4
  "description": "Oracle Data Modeler CSV Export to Apollo GraphQL Endpoint Generator",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -28,7 +28,7 @@
28
28
  "graphql-type-json": "^0.1.4",
29
29
  "lodash": "^4.17.4",
30
30
  "mustache": "^2.3.0",
31
- "nunjucks": "^3.0.1",
31
+ "nunjucks": "^3.2.3",
32
32
  "pluralize": "^5.0.0",
33
33
  "sql-formatter": "^1.2.2",
34
34
  "uuid": "^3.3.2"
@@ -55,6 +55,6 @@
55
55
  "pg": "^6.4.0",
56
56
  "require-from-string": "^1.2.1",
57
57
  "tg-client-query-builder": "^2.2.0",
58
- "tg-knex-query-resolver": "^4.0.0"
58
+ "tg-knex-query-resolver": "^4.1.0"
59
59
  }
60
60
  }
@@ -129,6 +129,10 @@ module.exports = function convertRowsToTableMap(
129
129
  tabAttr.referenceShouldCascade = true;
130
130
  }
131
131
 
132
+ if (_.endsWith(fkRelation.Relation_Name, "_restrict")) {
133
+ tabAttr.referenceShouldRestrict = true;
134
+ }
135
+
132
136
  refModel.associations.push(refAssociation);
133
137
  tableMap[refDef.entityName] = refModel;
134
138
  }
@@ -134,6 +134,10 @@ module.exports = function (
134
134
  if (attrName == "code") relSpec.onUpdate = "CASCADE";
135
135
  if (!attrDef.nullable || attrDef.referenceShouldCascade === true)
136
136
  relSpec.onDelete = "CASCADE";
137
+ // if (attrDef.referenceShouldRestrict === true) {
138
+ // relSpec.onDelete = "RESTRICT";
139
+ // console.log("DEBUG:relSpec:", relSpec)
140
+ // }
137
141
  knexSpec.relationships.push(relSpec);
138
142
  }
139
143