@famgia/omnify-atlas 2.0.2 → 2.0.4

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
@@ -174,6 +174,7 @@ function schemaToSnapshot(schema, hash, modifiedAt) {
174
174
  properties,
175
175
  id: opts?.id,
176
176
  idType: opts?.idType,
177
+ primaryKey: opts?.primaryKey,
177
178
  timestamps: opts?.timestamps,
178
179
  softDelete: opts?.softDelete,
179
180
  indexes,
@@ -356,6 +357,12 @@ function diffSchemaSnapshots(prev, curr) {
356
357
  optionChanges.idType = { from: prev.idType, to: curr.idType };
357
358
  hasOptionChanges = true;
358
359
  }
360
+ const prevPk = JSON.stringify(prev.primaryKey);
361
+ const currPk = JSON.stringify(curr.primaryKey);
362
+ if (prevPk !== currPk) {
363
+ optionChanges.primaryKey = { from: prev.primaryKey, to: curr.primaryKey };
364
+ hasOptionChanges = true;
365
+ }
359
366
  return {
360
367
  columnChanges: columnChanges.length > 0 ? columnChanges : void 0,
361
368
  indexChanges: indexChanges.length > 0 ? indexChanges : void 0,