diff --git a/db/migrations/1525122581_associate_receipts_with_blocks.down.sql b/db/migrations/1525122581_associate_receipts_with_blocks.down.sql index 0a32c92e..e6ce2266 100644 --- a/db/migrations/1525122581_associate_receipts_with_blocks.down.sql +++ b/db/migrations/1525122581_associate_receipts_with_blocks.down.sql @@ -3,6 +3,8 @@ BEGIN; ALTER TABLE receipts ADD COLUMN transaction_id INT; +CREATE INDEX transaction_id_index ON receipts (transaction_id); + UPDATE receipts SET transaction_id = ( SELECT id FROM transactions WHERE transactions.hash = receipts.tx_hash @@ -20,4 +22,4 @@ ON DELETE CASCADE; ALTER TABLE receipts DROP COLUMN block_id; -COMMIT; \ No newline at end of file +COMMIT;