@famgia/omnify-atlas 2.0.44 → 2.0.46

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.cjs CHANGED
@@ -280,6 +280,9 @@ function diffPropertySnapshots(prev, curr) {
280
280
  if (prev.onDelete !== curr.onDelete) modifications.push("onDelete");
281
281
  if (prev.onUpdate !== curr.onUpdate) modifications.push("onUpdate");
282
282
  if (prev.mappedBy !== curr.mappedBy) modifications.push("mappedBy");
283
+ if (prev.idType !== curr.idType) modifications.push("idType");
284
+ if (prev.joinTable !== curr.joinTable) modifications.push("joinTable");
285
+ if (JSON.stringify(prev.pivotFields) !== JSON.stringify(curr.pivotFields)) modifications.push("pivotFields");
283
286
  if (JSON.stringify(prev.fields) !== JSON.stringify(curr.fields)) modifications.push("fields");
284
287
  return modifications;
285
288
  }
@@ -386,6 +389,28 @@ function diffSchemaSnapshots(prev, curr) {
386
389
  optionChanges.primaryKey = { from: prev.primaryKey, to: curr.primaryKey };
387
390
  hasOptionChanges = true;
388
391
  }
392
+ const prevUc = JSON.stringify(prev.uniqueConstraints ?? []);
393
+ const currUc = JSON.stringify(curr.uniqueConstraints ?? []);
394
+ if (prevUc !== currUc) {
395
+ const prevConstraints = new Set((prev.uniqueConstraints ?? []).map((c) => JSON.stringify(c)));
396
+ const currConstraints = new Set((curr.uniqueConstraints ?? []).map((c) => JSON.stringify(c)));
397
+ for (const constraint of curr.uniqueConstraints ?? []) {
398
+ if (!prevConstraints.has(JSON.stringify(constraint))) {
399
+ indexChanges.push({
400
+ changeType: "added",
401
+ index: { columns: constraint, unique: true }
402
+ });
403
+ }
404
+ }
405
+ for (const constraint of prev.uniqueConstraints ?? []) {
406
+ if (!currConstraints.has(JSON.stringify(constraint))) {
407
+ indexChanges.push({
408
+ changeType: "removed",
409
+ index: { columns: constraint, unique: true }
410
+ });
411
+ }
412
+ }
413
+ }
389
414
  return {
390
415
  columnChanges: columnChanges.length > 0 ? columnChanges : void 0,
391
416
  indexChanges: indexChanges.length > 0 ? indexChanges : void 0,