@axiom-lattice/pg-stores 1.0.84 → 1.0.85

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.mjs CHANGED
@@ -57,6 +57,11 @@ var MigrationManager = class {
57
57
  const pkColumn = pkCheck.rows[0]?.column_name;
58
58
  const constraintName = pkCheck.rows[0]?.constraint_name;
59
59
  if (pkColumn === "version" && constraintName) {
60
+ await client.query(`
61
+ DELETE FROM lattice_schema_migrations a
62
+ USING lattice_schema_migrations b
63
+ WHERE a.name = b.name AND a.version < b.version
64
+ `);
60
65
  await client.query(
61
66
  `ALTER TABLE lattice_schema_migrations DROP CONSTRAINT ${constraintName}`
62
67
  );