Skip to content

Commit

Permalink
indexer: handle conflicts on migration 0013_recreate_table_transactio…
Browse files Browse the repository at this point in the history
…ns (hotfix)
  • Loading branch information
altergui committed Sep 6, 2024
1 parent 1a47b20 commit f802ea6
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ CREATE TABLE transactions_new (
-- Copy data from the old table to the new table
INSERT INTO transactions_new (hash, block_height, block_index, type)
SELECT hash, block_height, block_index, type
FROM transactions;
FROM transactions
ON CONFLICT(hash) DO UPDATE
SET block_height = excluded.block_height,
block_index = excluded.block_index,
type = excluded.type;

-- Drop the old table
DROP TABLE transactions;
Expand Down

0 comments on commit f802ea6

Please sign in to comment.