@famgia/omnify-laravel 0.0.53 → 0.0.54
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/dist/{chunk-TSRWUG2I.js → chunk-U7ZCSAYW.js} +4 -3
- package/dist/chunk-U7ZCSAYW.js.map +1 -0
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin.cjs +3 -2
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-TSRWUG2I.js.map +0 -1
package/dist/index.js
CHANGED
package/dist/plugin.cjs
CHANGED
|
@@ -202,6 +202,7 @@ function generatePolymorphicColumns(propertyName, property, allSchemas) {
|
|
|
202
202
|
if (assocProp.relation !== "MorphTo") {
|
|
203
203
|
return null;
|
|
204
204
|
}
|
|
205
|
+
const isNullable2 = assocProp.nullable !== false;
|
|
205
206
|
const targets = assocProp.targets;
|
|
206
207
|
if (!targets || targets.length === 0) {
|
|
207
208
|
return null;
|
|
@@ -213,7 +214,7 @@ function generatePolymorphicColumns(propertyName, property, allSchemas) {
|
|
|
213
214
|
name: typeColumnName,
|
|
214
215
|
method: "enum",
|
|
215
216
|
args: [typeColumnName, targets],
|
|
216
|
-
modifiers: [{ method: "nullable" }]
|
|
217
|
+
modifiers: isNullable2 ? [{ method: "nullable" }] : []
|
|
217
218
|
};
|
|
218
219
|
let idMethod = "unsignedBigInteger";
|
|
219
220
|
for (const targetName of targets) {
|
|
@@ -232,7 +233,7 @@ function generatePolymorphicColumns(propertyName, property, allSchemas) {
|
|
|
232
233
|
name: idColumnName,
|
|
233
234
|
method: idMethod,
|
|
234
235
|
args: idMethod === "string" ? [idColumnName, 255] : [idColumnName],
|
|
235
|
-
modifiers: [{ method: "nullable" }]
|
|
236
|
+
modifiers: isNullable2 ? [{ method: "nullable" }] : []
|
|
236
237
|
};
|
|
237
238
|
const indexes = [
|
|
238
239
|
{
|