misc adjustments

This commit is contained in:
i-norden 2022-08-08 10:50:27 -05:00
parent a8395d1413
commit 0856168b92
5 changed files with 8 additions and 4 deletions

View File

@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS eth.header_cids (
state_root VARCHAR(66) NOT NULL,
tx_root VARCHAR(66) NOT NULL,
receipt_root VARCHAR(66) NOT NULL,
uncle_root VARCHAR(66) NOT NULL,
uncles_hash VARCHAR(66) NOT NULL,
bloom BYTEA NOT NULL,
timestamp BIGINT NOT NULL,
mh_key TEXT NOT NULL,

View File

@ -4,7 +4,7 @@ CREATE TABLE IF NOT EXISTS eth.transaction_cids (
header_id VARCHAR(66) NOT NULL,
tx_hash VARCHAR(66) NOT NULL,
cid TEXT NOT NULL,
dst VARCHAR(66) NOT NULL,
dst VARCHAR(66),
src VARCHAR(66) NOT NULL,
index INTEGER NOT NULL,
mh_key TEXT NOT NULL,

View File

@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS eth.receipt_cids (
contract_hash VARCHAR(66),
leaf_mh_key TEXT NOT NULL,
post_state VARCHAR(66),
post_status INTEGER,
post_status SMALLINT,
log_root VARCHAR(66),
PRIMARY KEY (tx_id, header_id, block_number)
);

View File

@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS eth.state_accounts (
state_path BYTEA NOT NULL,
balance NUMERIC NOT NULL,
nonce BIGINT NOT NULL,
code_hash BYTEA NOT NULL,
code_hash VARCHAR(66) NOT NULL,
storage_root VARCHAR(66) NOT NULL,
PRIMARY KEY (state_path, header_id, block_number)
);

View File

@ -18,6 +18,7 @@ CREATE INDEX tx_cid_index ON eth.transaction_cids USING btree (cid, block_number
CREATE INDEX tx_mh_block_number_index ON eth.transaction_cids USING btree (mh_key, block_number);
CREATE INDEX tx_dst_index ON eth.transaction_cids USING btree (dst);
CREATE INDEX tx_src_index ON eth.transaction_cids USING btree (src);
CREATE INDEX tx_data_index ON eth.transaction_cids USING hash (tx_data);
-- receipt indexes
CREATE INDEX rct_block_number_index ON eth.receipt_cids USING brin (block_number);
@ -64,9 +65,11 @@ CREATE INDEX log_topic0_index ON eth.log_cids USING btree (topic0);
CREATE INDEX log_topic1_index ON eth.log_cids USING btree (topic1);
CREATE INDEX log_topic2_index ON eth.log_cids USING btree (topic2);
CREATE INDEX log_topic3_index ON eth.log_cids USING btree (topic3);
CREATE INDEX log_data_index ON eth.log_cids USING hash (log_data);
-- +goose Down
-- log indexes
DROP INDEX eth.log_data_index;
DROP INDEX eth.log_topic3_index;
DROP INDEX eth.log_topic2_index;
DROP INDEX eth.log_topic1_index;
@ -113,6 +116,7 @@ DROP INDEX eth.rct_header_id_index;
DROP INDEX eth.rct_block_number_index;
-- transaction indexes
DROP INDEX eth.tx_data_index;
DROP INDEX eth.tx_src_index;
DROP INDEX eth.tx_dst_index;
DROP INDEX eth.tx_mh_block_number_index;