From 2b4b6be1b08516eea53873558f682e7ce58a9a5c Mon Sep 17 00:00:00 2001 From: Kostas Dermentzis Date: Thu, 8 Aug 2024 17:17:17 +0300 Subject: [PATCH] Make view migration idempotent Fixes https://github.com/IntersectMBO/cardano-db-sync/issues/1801 --- schema/migration-3-0001-20190816.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schema/migration-3-0001-20190816.sql b/schema/migration-3-0001-20190816.sql index a222c4232..d56a7993f 100644 --- a/schema/migration-3-0001-20190816.sql +++ b/schema/migration-3-0001-20190816.sql @@ -8,7 +8,7 @@ -- A utxo view which shows all unspent transaction outputs including the un-redeemed redeem -- addresses. -create view utxo_byron_view as select +create or replace view utxo_byron_view as select tx_out.* from tx_out left outer join tx_in on tx_out.tx_id = tx_in.tx_out_id and tx_out.index = tx_in.tx_out_index @@ -19,7 +19,7 @@ create view utxo_byron_view as select -- addresses. -- This should produce the same query results as the above `utxo_byron_view` for Shelley addresses -- and non-redeem Byron addresses. -create view utxo_view as select +create or replace view utxo_view as select tx_out.* from tx_out left outer join tx_in on tx_out.tx_id = tx_in.tx_out_id and tx_out.index = tx_in.tx_out_index