@famgia/omnify-laravel 0.0.34 → 0.0.36
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-BYMCYVUK.js → chunk-4FPVRQVO.js} +7 -5
- package/dist/chunk-4FPVRQVO.js.map +1 -0
- package/dist/index.cjs +6 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin.cjs +6 -4
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-BYMCYVUK.js.map +0 -1
package/dist/index.js
CHANGED
package/dist/plugin.cjs
CHANGED
|
@@ -53,7 +53,7 @@ var TYPE_METHOD_MAP = {
|
|
|
53
53
|
};
|
|
54
54
|
var PK_METHOD_MAP = {
|
|
55
55
|
Int: "increments",
|
|
56
|
-
BigInt: "
|
|
56
|
+
BigInt: "id",
|
|
57
57
|
Uuid: "uuid",
|
|
58
58
|
String: "string"
|
|
59
59
|
};
|
|
@@ -133,7 +133,7 @@ function propertyToColumnMethod(propertyName, property, options = {}) {
|
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
function generatePrimaryKeyColumn(pkType = "BigInt") {
|
|
136
|
-
const method = PK_METHOD_MAP[pkType] ?? "
|
|
136
|
+
const method = PK_METHOD_MAP[pkType] ?? "id";
|
|
137
137
|
if (pkType === "Uuid") {
|
|
138
138
|
return {
|
|
139
139
|
name: "id",
|
|
@@ -153,7 +153,7 @@ function generatePrimaryKeyColumn(pkType = "BigInt") {
|
|
|
153
153
|
return {
|
|
154
154
|
name: "id",
|
|
155
155
|
method,
|
|
156
|
-
args: ["id"],
|
|
156
|
+
args: method === "id" ? [] : ["id"],
|
|
157
157
|
modifiers: []
|
|
158
158
|
};
|
|
159
159
|
}
|
|
@@ -313,7 +313,9 @@ function expandCompoundType(propName, property, customTypes, options = {}) {
|
|
|
313
313
|
const sqlType = field.sql.sqlType.toUpperCase();
|
|
314
314
|
if (sqlType === "VARCHAR" || sqlType === "CHAR" || sqlType === "STRING") {
|
|
315
315
|
expandedProp.type = "String";
|
|
316
|
-
if (
|
|
316
|
+
if (fieldOverride?.length) {
|
|
317
|
+
expandedProp.length = fieldOverride.length;
|
|
318
|
+
} else if (field.sql.length) {
|
|
317
319
|
expandedProp.length = field.sql.length;
|
|
318
320
|
}
|
|
319
321
|
} else if (sqlType === "TINYINT") {
|