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.
This commit is contained in:
Boris Nagaev 2025-04-04 16:31:57 -03:00
parent bfe7991c4e
commit 38b7ecdb9d
No known key found for this signature in database

View file

@ -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;