@famgia/omnify-laravel 0.0.52 → 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-VS3UOQWY.js → chunk-U7ZCSAYW.js} +13 -3
- package/dist/chunk-U7ZCSAYW.js.map +1 -0
- package/dist/index.cjs +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin.cjs +12 -2
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-VS3UOQWY.js.map +0 -1
package/dist/index.js
CHANGED
package/dist/plugin.cjs
CHANGED
|
@@ -122,6 +122,15 @@ function propertyToColumnMethod(propertyName, property, options = {}) {
|
|
|
122
122
|
if (baseProp.unsigned && (method === "tinyInteger" || method === "integer" || method === "bigInteger")) {
|
|
123
123
|
modifiers.push({ method: "unsigned" });
|
|
124
124
|
}
|
|
125
|
+
if (method === "timestamp") {
|
|
126
|
+
const timestampProp = property;
|
|
127
|
+
if (timestampProp.useCurrent) {
|
|
128
|
+
modifiers.push({ method: "useCurrent" });
|
|
129
|
+
}
|
|
130
|
+
if (timestampProp.useCurrentOnUpdate) {
|
|
131
|
+
modifiers.push({ method: "useCurrentOnUpdate" });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
125
134
|
const rawDisplayName = property.displayName;
|
|
126
135
|
if (rawDisplayName) {
|
|
127
136
|
const displayName = (0, import_omnify_types.resolveLocalizedString)(rawDisplayName, options.locale);
|
|
@@ -193,6 +202,7 @@ function generatePolymorphicColumns(propertyName, property, allSchemas) {
|
|
|
193
202
|
if (assocProp.relation !== "MorphTo") {
|
|
194
203
|
return null;
|
|
195
204
|
}
|
|
205
|
+
const isNullable2 = assocProp.nullable !== false;
|
|
196
206
|
const targets = assocProp.targets;
|
|
197
207
|
if (!targets || targets.length === 0) {
|
|
198
208
|
return null;
|
|
@@ -204,7 +214,7 @@ function generatePolymorphicColumns(propertyName, property, allSchemas) {
|
|
|
204
214
|
name: typeColumnName,
|
|
205
215
|
method: "enum",
|
|
206
216
|
args: [typeColumnName, targets],
|
|
207
|
-
modifiers: [{ method: "nullable" }]
|
|
217
|
+
modifiers: isNullable2 ? [{ method: "nullable" }] : []
|
|
208
218
|
};
|
|
209
219
|
let idMethod = "unsignedBigInteger";
|
|
210
220
|
for (const targetName of targets) {
|
|
@@ -223,7 +233,7 @@ function generatePolymorphicColumns(propertyName, property, allSchemas) {
|
|
|
223
233
|
name: idColumnName,
|
|
224
234
|
method: idMethod,
|
|
225
235
|
args: idMethod === "string" ? [idColumnName, 255] : [idColumnName],
|
|
226
|
-
modifiers: [{ method: "nullable" }]
|
|
236
|
+
modifiers: isNullable2 ? [{ method: "nullable" }] : []
|
|
227
237
|
};
|
|
228
238
|
const indexes = [
|
|
229
239
|
{
|