From 38b7ecdb9d5d9e3b5978949b5e06f042a6f5534d Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Fri, 4 Apr 2025 16:31:57 -0300 Subject: [PATCH] loopdb: fix migration 13 for Postgres Don't copy values of ID column from sweeps to sweeps2 and let it auto-assign values there. This is needed for the sequencer for that column to be up-to-date with the values. --- loopdb/sqlc/migrations/000013_batcher_key_outpoint.up.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/loopdb/sqlc/migrations/000013_batcher_key_outpoint.up.sql b/loopdb/sqlc/migrations/000013_batcher_key_outpoint.up.sql index 36e27960..eb66f705 100644 --- a/loopdb/sqlc/migrations/000013_batcher_key_outpoint.up.sql +++ b/loopdb/sqlc/migrations/000013_batcher_key_outpoint.up.sql @@ -48,10 +48,9 @@ WITH RECURSIVE seq(i) AS ( SELECT i + 1 FROM seq WHERE i < 32 ) INSERT INTO sweeps2 ( - id, swap_hash, batch_id, outpoint, amt, completed + swap_hash, batch_id, outpoint, amt, completed ) SELECT - id, swap_hash, batch_id, ( @@ -60,7 +59,8 @@ SELECT ) || ':' || CAST(outpoint_index AS TEXT), amt, completed -FROM sweeps; +FROM sweeps +ORDER BY id ASC; -- Rename tables. ALTER TABLE sweeps RENAME TO sweeps_old;