@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/index.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  schemaToBlueprint,
23
23
  toColumnName,
24
24
  toTableName
25
- } from "./chunk-TSRWUG2I.js";
25
+ } from "./chunk-U7ZCSAYW.js";
26
26
  export {
27
27
  formatColumnMethod,
28
28
  formatForeignKey,
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
  {