@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/index.js CHANGED
@@ -22,7 +22,7 @@ import {
22
22
  schemaToBlueprint,
23
23
  toColumnName,
24
24
  toTableName
25
- } from "./chunk-BYMCYVUK.js";
25
+ } from "./chunk-4FPVRQVO.js";
26
26
  export {
27
27
  formatColumnMethod,
28
28
  formatForeignKey,
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: "bigIncrements",
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] ?? "bigIncrements";
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 (field.sql.length) {
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") {