-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
468 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
-- +goose Up | ||
CREATE TABLE eth.log_cids ( | ||
id SERIAL PRIMARY KEY, | ||
receipt_id INTEGER NOT NULL REFERENCES eth.receipt_cids (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, | ||
address TEXT NOT NULL, | ||
cid TEXT NOT NULL, | ||
mh_key TEXT NOT NULL REFERENCES public.blocks (key) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED, | ||
block_number BIGINT NOT NULL, | ||
block_hash VARCHAR(66) NOT NULL, | ||
tx_hash VARCHAR(66) NOT NULL, | ||
tx_index INTEGER NOT NULL, | ||
index INTEGER NOT NULL, | ||
topic0s VARCHAR(66)[], | ||
topic1s VARCHAR(66)[], | ||
topic2s VARCHAR(66)[], | ||
topic3s VARCHAR(66)[], | ||
UNIQUE (block_hash, tx_hash, index) | ||
); | ||
|
||
-- TODO: Remove topics from receipts to avoid redundancy. | ||
-- ALTER TABLE eth.receipt_cids | ||
-- DROP COLUMN topic0s, | ||
-- DROP COLUMN topic1s, | ||
-- DROP COLUMN topic2s, | ||
-- DROP COLUMN topic3s, | ||
ALTER TABLE eth.receipt_cids | ||
ADD COLUMN log_root VARCHAR(66); | ||
|
||
CREATE INDEX log_rct_id_index ON eth.log_cids USING btree (receipt_id); | ||
|
||
CREATE INDEX log_mh_index ON eth.log_cids USING btree (mh_key); | ||
|
||
CREATE INDEX log_cid_index ON eth.log_cids USING btree (cid); | ||
|
||
-- | ||
-- Name: log_topic0_index; Type: INDEX; Schema: eth; Owner: - | ||
-- | ||
|
||
CREATE INDEX log_topic0_index ON eth.log_cids USING gin (topic0s); | ||
|
||
|
||
-- | ||
-- Name: log_topic1_index; Type: INDEX; Schema: eth; Owner: - | ||
-- | ||
|
||
CREATE INDEX log_topic1_index ON eth.log_cids USING gin (topic1s); | ||
|
||
|
||
-- | ||
-- Name: log_topic2_index; Type: INDEX; Schema: eth; Owner: - | ||
-- | ||
|
||
CREATE INDEX log_topic2_index ON eth.log_cids USING gin (topic2s); | ||
|
||
|
||
-- | ||
-- Name: log_topic3_index; Type: INDEX; Schema: eth; Owner: - | ||
-- | ||
|
||
CREATE INDEX log_topic3_index ON eth.log_cids USING gin (topic3s); | ||
|
||
|
||
-- +goose Down | ||
DROP TABLE eth.logs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.