@famgia/omnify-laravel 0.0.15 → 0.0.16
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-REDFZUQY.js → chunk-CAWNYSF3.js} +9 -2
- package/dist/chunk-CAWNYSF3.js.map +1 -0
- package/dist/index.cjs +8 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin.cjs +8 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-REDFZUQY.js.map +0 -1
package/dist/index.js
CHANGED
package/dist/plugin.cjs
CHANGED
|
@@ -238,11 +238,18 @@ function generateForeignKey(propertyName, property, allSchemas) {
|
|
|
238
238
|
} else if (targetPkType === "String") {
|
|
239
239
|
method = "string";
|
|
240
240
|
}
|
|
241
|
+
const modifiers = [];
|
|
242
|
+
if (assocProp.nullable || assocProp.relation === "ManyToOne") {
|
|
243
|
+
modifiers.push({ method: "nullable" });
|
|
244
|
+
}
|
|
245
|
+
if (assocProp.default !== void 0 && assocProp.default !== null) {
|
|
246
|
+
modifiers.push({ method: "default", args: [assocProp.default] });
|
|
247
|
+
}
|
|
241
248
|
const column = {
|
|
242
249
|
name: columnName,
|
|
243
250
|
method,
|
|
244
251
|
args: [columnName],
|
|
245
|
-
modifiers
|
|
252
|
+
modifiers
|
|
246
253
|
};
|
|
247
254
|
const foreignKey = {
|
|
248
255
|
columns: [columnName],
|