@famgia/omnify-laravel 2.0.36 → 2.0.38

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.
@@ -1189,7 +1189,7 @@ function detectCircularDependencies(schemas) {
1189
1189
  const circularFKs = /* @__PURE__ */ new Set();
1190
1190
  const graph = /* @__PURE__ */ new Map();
1191
1191
  for (const schema of Object.values(schemas)) {
1192
- if (schema.kind === "enum" || !schema.properties) continue;
1192
+ if (schema.kind === "enum" || schema.kind === "partial" || !schema.properties) continue;
1193
1193
  const refs = /* @__PURE__ */ new Map();
1194
1194
  for (const [propName, property] of Object.entries(schema.properties)) {
1195
1195
  if (property.type !== "Association") continue;
@@ -1221,7 +1221,7 @@ function detectCircularDependencies(schemas) {
1221
1221
  function extractDeferredFKs(schemas, circularFKs) {
1222
1222
  const deferred = [];
1223
1223
  for (const schema of Object.values(schemas)) {
1224
- if (schema.kind === "enum" || !schema.properties) continue;
1224
+ if (schema.kind === "enum" || schema.kind === "partial" || !schema.properties) continue;
1225
1225
  const tableName = schema.options?.tableName ?? toTableName(schema.name);
1226
1226
  for (const [propName, property] of Object.entries(schema.properties)) {
1227
1227
  const key = `${schema.name}.${propName}`;
@@ -1323,7 +1323,7 @@ ${downStatements.join("\n\n")}
1323
1323
  };
1324
1324
  }
1325
1325
  function topologicalSort(schemas) {
1326
- const schemaList = Object.values(schemas).filter((s) => s.kind !== "enum");
1326
+ const schemaList = Object.values(schemas).filter((s) => s.kind !== "enum" && s.kind !== "partial");
1327
1327
  const sorted = [];
1328
1328
  const visited = /* @__PURE__ */ new Set();
1329
1329
  const visiting = /* @__PURE__ */ new Set();
@@ -1338,7 +1338,7 @@ function topologicalSort(schemas) {
1338
1338
  const deps = extractDependencies(schema);
1339
1339
  for (const depName of deps) {
1340
1340
  const depSchema = schemas[depName];
1341
- if (depSchema && depSchema.kind !== "enum") {
1341
+ if (depSchema && depSchema.kind !== "enum" && depSchema.kind !== "partial") {
1342
1342
  visit(depSchema);
1343
1343
  }
1344
1344
  }
@@ -5415,10 +5415,10 @@ function laravelPlugin(options) {
5415
5415
  ctx.changes.filter((c) => c.changeType === "added").map((c) => c.schemaName)
5416
5416
  );
5417
5417
  if (addedSchemaNames.size > 0) {
5418
- const addedSchemas = Object.fromEntries(
5419
- Object.entries(ctx.schemas).filter(([name]) => addedSchemaNames.has(name))
5418
+ const allMigrations = generateMigrations(ctx.schemas, migrationOptions);
5419
+ const createMigrations = allMigrations.filter(
5420
+ (m) => m.schemaName && addedSchemaNames.has(m.schemaName)
5420
5421
  );
5421
- const createMigrations = generateMigrations(addedSchemas, migrationOptions);
5422
5422
  for (const migration of createMigrations) {
5423
5423
  const tableName = migration.tables[0];
5424
5424
  if (hasMigration(tableName, migration.schemaName)) {
@@ -5690,4 +5690,4 @@ export {
5690
5690
  getFactoryPath,
5691
5691
  laravelPlugin
5692
5692
  };
5693
- //# sourceMappingURL=chunk-FE7YXEZW.js.map
5693
+ //# sourceMappingURL=chunk-FC5YBER4.js.map