diff --git a/db/migrations/00007_create_eth_receipt_cids_table.sql b/db/migrations/00007_create_eth_receipt_cids_table.sql index 041aa57..266da4b 100644 --- a/db/migrations/00007_create_eth_receipt_cids_table.sql +++ b/db/migrations/00007_create_eth_receipt_cids_table.sql @@ -3,13 +3,12 @@ CREATE TABLE IF NOT EXISTS eth.receipt_cids ( block_number BIGINT NOT NULL, header_id VARCHAR(66) NOT NULL, tx_id VARCHAR(66) NOT NULL, - leaf_cid TEXT NOT NULL, + cid TEXT NOT NULL, contract VARCHAR(66), contract_hash VARCHAR(66), - leaf_mh_key TEXT NOT NULL, + mh_key TEXT NOT NULL, post_state VARCHAR(66), post_status SMALLINT, - log_root VARCHAR(66), PRIMARY KEY (tx_id, header_id, block_number) ); diff --git a/db/migrations/00008_create_eth_state_cids_table.sql b/db/migrations/00008_create_eth_state_cids_table.sql index 35a50fc..da73717 100644 --- a/db/migrations/00008_create_eth_state_cids_table.sql +++ b/db/migrations/00008_create_eth_state_cids_table.sql @@ -4,7 +4,7 @@ CREATE TABLE IF NOT EXISTS eth.state_cids ( header_id VARCHAR(66) NOT NULL, state_leaf_key VARCHAR(66) NOT NULL, cid TEXT NOT NULL, - state_path BYTEA NOT NULL, + partial_path BYTEA NOT NULL, diff BOOLEAN NOT NULL DEFAULT FALSE, mh_key TEXT NOT NULL, balance NUMERIC, -- NULL if "removed" diff --git a/db/migrations/00009_create_eth_storage_cids_table.sql b/db/migrations/00009_create_eth_storage_cids_table.sql index 1df408e..a42af46 100644 --- a/db/migrations/00009_create_eth_storage_cids_table.sql +++ b/db/migrations/00009_create_eth_storage_cids_table.sql @@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS eth.storage_cids ( state_leaf_key VARCHAR(66) NOT NULL, storage_leaf_key VARCHAR(66) NOT NULL, cid TEXT NOT NULL, - storage_path BYTEA NOT NULL, + partial_path BYTEA NOT NULL, diff BOOLEAN NOT NULL DEFAULT FALSE, mh_key TEXT NOT NULL, val BYTEA, -- NULL if "removed" diff --git a/db/migrations/00011_create_eth_log_cids_table.sql b/db/migrations/00011_create_eth_log_cids_table.sql index b55b5ce..fae2869 100644 --- a/db/migrations/00011_create_eth_log_cids_table.sql +++ b/db/migrations/00011_create_eth_log_cids_table.sql @@ -2,8 +2,8 @@ CREATE TABLE IF NOT EXISTS eth.log_cids ( block_number BIGINT NOT NULL, header_id VARCHAR(66) NOT NULL, - leaf_cid TEXT NOT NULL, - leaf_mh_key TEXT NOT NULL, + cid TEXT NOT NULL, + mh_key TEXT NOT NULL, rct_id VARCHAR(66) NOT NULL, address VARCHAR(66) NOT NULL, index INTEGER NOT NULL, diff --git a/db/migrations/00013_create_pending_tx_table.sql b/db/migrations/00013_create_pending_tx_table.sql index 327925a..33f4bdb 100644 --- a/db/migrations/00013_create_pending_tx_table.sql +++ b/db/migrations/00013_create_pending_tx_table.sql @@ -5,6 +5,7 @@ -- instead, what we are doing for the time being is embedding the RLP here CREATE TABLE IF NOT EXISTS eth.pending_txs ( tx_hash VARCHAR(66) NOT NULL PRIMARY KEY, + timestamp BIGINT NOT NULL, raw BYTEA NOT NULL ); diff --git a/db/migrations/00014_create_cid_indexes.sql b/db/migrations/00014_create_cid_indexes.sql index 8b063a5..02615f6 100644 --- a/db/migrations/00014_create_cid_indexes.sql +++ b/db/migrations/00014_create_cid_indexes.sql @@ -23,8 +23,8 @@ CREATE INDEX tx_data_index ON eth.transaction_cids USING btree (tx_data); -- receipt indexes CREATE INDEX rct_block_number_index ON eth.receipt_cids USING brin (block_number); CREATE INDEX rct_header_id_index ON eth.receipt_cids USING btree (header_id); -CREATE INDEX rct_leaf_cid_index ON eth.receipt_cids USING btree (leaf_cid); -CREATE INDEX rct_leaf_mh_block_number_index ON eth.receipt_cids USING btree (leaf_mh_key, block_number); +CREATE INDEX rct_cid_index ON eth.receipt_cids USING btree (cid); +CREATE INDEX rct_mh_block_number_index ON eth.receipt_cids USING btree (mh_key, block_number); CREATE INDEX rct_contract_index ON eth.receipt_cids USING btree (contract); CREATE INDEX rct_contract_hash_index ON eth.receipt_cids USING btree (contract_hash); @@ -56,8 +56,8 @@ CREATE INDEX access_list_storage_keys_index ON eth.access_list_elements USING gi -- log indexes CREATE INDEX log_block_number_index ON eth.log_cids USING brin (block_number); CREATE INDEX log_header_id_index ON eth.log_cids USING btree (header_id); -CREATE INDEX log_leaf_mh_block_number_index ON eth.log_cids USING btree (leaf_mh_key, block_number); -CREATE INDEX log_cid_index ON eth.log_cids USING btree (leaf_cid); +CREATE INDEX log_mh_block_number_index ON eth.log_cids USING btree (mh_key, block_number); +CREATE INDEX log_cid_index ON eth.log_cids USING btree (cid); CREATE INDEX log_address_index ON eth.log_cids USING btree (address); CREATE INDEX log_topic0_index ON eth.log_cids USING btree (topic0); CREATE INDEX log_topic1_index ON eth.log_cids USING btree (topic1); @@ -74,7 +74,7 @@ DROP INDEX eth.log_topic1_index; DROP INDEX eth.log_topic0_index; DROP INDEX eth.log_address_index; DROP INDEX eth.log_cid_index; -DROP INDEX eth.log_leaf_mh_block_number_index; +DROP INDEX eth.log_mh_block_number_index; DROP INDEX eth.log_header_id_index; DROP INDEX eth.log_block_number_index; @@ -107,8 +107,8 @@ DROP INDEX eth.state_leaf_key_block_number_index; -- receipt indexes DROP INDEX eth.rct_contract_hash_index; DROP INDEX eth.rct_contract_index; -DROP INDEX eth.rct_leaf_mh_block_number_index; -DROP INDEX eth.rct_leaf_cid_index; +DROP INDEX eth.rct_mh_block_number_index; +DROP INDEX eth.rct_cid_index; DROP INDEX eth.rct_header_id_index; DROP INDEX eth.rct_block_number_index;