add back raw contract address

This commit is contained in:
Ian Norden
2020-04-04 15:45:55 -05:00
parent 8960cde4f7
commit f2e853e9c9
8 changed files with 20 additions and 10 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ ALTER TABLE eth.receipt_cids
ADD COLUMN log_contracts VARCHAR(66)[];
ALTER TABLE eth.receipt_cids
RENAME COLUMN contract TO contract_hash;
ADD COLUMN contract_hash VARCHAR(66);
WITH uniques AS (SELECT DISTINCT ON (tx_id) * FROM eth.receipt_cids)
DELETE FROM eth.receipt_cids WHERE receipt_cids.id NOT IN (SELECT id FROM uniques);
@@ -16,7 +16,7 @@ ALTER TABLE eth.receipt_cids
DROP CONSTRAINT receipt_cids_tx_id_key;
ALTER TABLE eth.receipt_cids
RENAME COLUMN contract_hash TO contract;
DROP COLUMN contract_hash;
ALTER TABLE eth.receipt_cids
DROP COLUMN log_contracts;
+3 -2
View File
@@ -353,12 +353,13 @@ CREATE TABLE eth.receipt_cids (
id integer NOT NULL,
tx_id integer NOT NULL,
cid text NOT NULL,
contract_hash character varying(66),
contract character varying(66),
topic0s character varying(66)[],
topic1s character varying(66)[],
topic2s character varying(66)[],
topic3s character varying(66)[],
log_contracts character varying(66)[]
log_contracts character varying(66)[],
contract_hash character varying(66)
);