oradm-to-gql 34.0.1 → 34.0.2
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
@@ -125,6 +125,7 @@ module.exports = function convertRowsToTableMap(
|
|
125
125
|
refAssociation.name = pluralize.plural(refAssociation.name);
|
126
126
|
}
|
127
127
|
|
128
|
+
// TODO: we could better obtain this info from the ODM XML file.
|
128
129
|
if (_.endsWith(fkRelation.Relation_Name, "_cascade")) {
|
129
130
|
tabAttr.referenceShouldCascade = true;
|
130
131
|
}
|
@@ -133,6 +134,10 @@ module.exports = function convertRowsToTableMap(
|
|
133
134
|
tabAttr.referenceShouldRestrict = true;
|
134
135
|
}
|
135
136
|
|
137
|
+
if (_.endsWith(fkRelation.Relation_Name, "_noaction")) {
|
138
|
+
tabAttr.referenceShouldNoAction = true;
|
139
|
+
}
|
140
|
+
|
136
141
|
refModel.associations.push(refAssociation);
|
137
142
|
tableMap[refDef.entityName] = refModel;
|
138
143
|
}
|
@@ -134,10 +134,11 @@ 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.
|
137
|
+
if (attrDef.referenceShouldNoAction === true)
|
138
|
+
relSpec.onDelete = "NO ACTION";
|
139
|
+
if (attrDef.referenceShouldRestrict === true)
|
138
140
|
relSpec.onDelete = "RESTRICT";
|
139
|
-
|
140
|
-
}
|
141
|
+
|
141
142
|
knexSpec.relationships.push(relSpec);
|
142
143
|
}
|
143
144
|
|