@famgia/omnify-laravel 2.0.3 → 2.0.5

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.
@@ -69,6 +69,9 @@ function getIdType(schema) {
69
69
  return schema.options?.idType ?? "BigInt";
70
70
  }
71
71
  function hasAutoId(schema) {
72
+ if (schema.options?.primaryKey !== void 0) {
73
+ return false;
74
+ }
72
75
  return schema.options?.id !== false;
73
76
  }
74
77
  function toColumnName(propertyName) {
@@ -561,6 +564,9 @@ function schemaToBlueprint(schema, allSchemas, options = {}) {
561
564
  let primaryKey;
562
565
  if (hasAutoId(schema)) {
563
566
  primaryKey = ["id"];
567
+ } else if (schema.options?.primaryKey !== void 0) {
568
+ const pk = schema.options.primaryKey;
569
+ primaryKey = typeof pk === "string" ? [pk] : [...pk];
564
570
  } else if (schema.properties) {
565
571
  const pkColumns = [];
566
572
  for (const [propName, property] of Object.entries(schema.properties)) {
@@ -5384,4 +5390,4 @@ export {
5384
5390
  shouldGenerateAIGuides,
5385
5391
  laravelPlugin
5386
5392
  };
5387
- //# sourceMappingURL=chunk-O7CQJR4A.js.map
5393
+ //# sourceMappingURL=chunk-BWLXGHVF.js.map