diff --git a/db/migrations/00004_create_eth_header_cids_table.sql b/db/migrations/00004_create_eth_header_cids_table.sql index 37f775e..27e2291 100644 --- a/db/migrations/00004_create_eth_header_cids_table.sql +++ b/db/migrations/00004_create_eth_header_cids_table.sql @@ -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, diff --git a/db/migrations/00006_create_eth_transaction_cids_table.sql b/db/migrations/00006_create_eth_transaction_cids_table.sql index c35f775..e4c14d6 100644 --- a/db/migrations/00006_create_eth_transaction_cids_table.sql +++ b/db/migrations/00006_create_eth_transaction_cids_table.sql @@ -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, diff --git a/db/migrations/00007_create_eth_receipt_cids_table.sql b/db/migrations/00007_create_eth_receipt_cids_table.sql index c9a288c..041aa57 100644 --- a/db/migrations/00007_create_eth_receipt_cids_table.sql +++ b/db/migrations/00007_create_eth_receipt_cids_table.sql @@ -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) ); diff --git a/db/migrations/00010_create_eth_state_accounts_table.sql b/db/migrations/00010_create_eth_state_accounts_table.sql index d402ee4..f9f71b0 100644 --- a/db/migrations/00010_create_eth_state_accounts_table.sql +++ b/db/migrations/00010_create_eth_state_accounts_table.sql @@ -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) ); diff --git a/db/migrations/00014_create_cid_indexes.sql b/db/migrations/00014_create_cid_indexes.sql index 5f5868f..662d040 100644 --- a/db/migrations/00014_create_cid_indexes.sql +++ b/db/migrations/00014_create_cid_indexes.sql @@ -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;