oradm-to-gql 34.1.1-rc → 34.2.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.
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 also obtain this info more reliably from the ODM XML file.
|
128
129
|
if (_.endsWith(fkRelation.Relation_Name, "_cascade")) {
|
129
130
|
tabAttr.referenceShouldCascade = true;
|
130
131
|
}
|
@@ -133,6 +134,14 @@ 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
|
+
|
141
|
+
if (_.endsWith(fkRelation.Relation_Name, "_setdefault")) {
|
142
|
+
tabAttr.referenceShouldSetDefault = true;
|
143
|
+
}
|
144
|
+
|
136
145
|
refModel.associations.push(refAssociation);
|
137
146
|
tableMap[refDef.entityName] = refModel;
|
138
147
|
}
|
@@ -134,10 +134,13 @@ 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
|
+
if (attrDef.referenceShouldSetDefault === true)
|
142
|
+
relSpec.onDelete = "SET DEFAULT";
|
143
|
+
|
141
144
|
knexSpec.relationships.push(relSpec);
|
142
145
|
}
|
143
146
|
|