diff --git a/db/migrations/00010_create_eth_access_list_elements_table.sql b/db/migrations/00010_create_eth_access_list_elements_table.sql deleted file mode 100644 index e7384b8..0000000 --- a/db/migrations/00010_create_eth_access_list_elements_table.sql +++ /dev/null @@ -1,12 +0,0 @@ --- +goose Up -CREATE TABLE IF NOT EXISTS eth.access_list_elements ( - block_number BIGINT NOT NULL, - tx_id VARCHAR(66) NOT NULL, - index INTEGER NOT NULL, - address VARCHAR(66), - storage_keys VARCHAR(66)[], - PRIMARY KEY (tx_id, index, block_number) -); - --- +goose Down -DROP TABLE eth.access_list_elements; diff --git a/db/migrations/00011_create_eth_log_cids_table.sql b/db/migrations/00010_create_eth_log_cids_table.sql similarity index 100% rename from db/migrations/00011_create_eth_log_cids_table.sql rename to db/migrations/00010_create_eth_log_cids_table.sql diff --git a/db/migrations/00012_create_postgraphile_comments.sql b/db/migrations/00011_create_postgraphile_comments.sql similarity index 100% rename from db/migrations/00012_create_postgraphile_comments.sql rename to db/migrations/00011_create_postgraphile_comments.sql diff --git a/db/migrations/00013_create_cid_indexes.sql b/db/migrations/00012_create_cid_indexes.sql similarity index 90% rename from db/migrations/00013_create_cid_indexes.sql rename to db/migrations/00012_create_cid_indexes.sql index e609144..755c1b6 100644 --- a/db/migrations/00013_create_cid_indexes.sql +++ b/db/migrations/00012_create_cid_indexes.sql @@ -39,11 +39,6 @@ CREATE INDEX storage_header_id_index ON eth.storage_cids USING btree (header_id) CREATE INDEX storage_removed_index ON eth.storage_cids USING btree (removed); CREATE INDEX storage_leaf_key_block_number_index ON eth.storage_cids(storage_leaf_key, block_number DESC); --- access list indexes -CREATE INDEX access_list_block_number_index ON eth.access_list_elements USING btree (block_number); -CREATE INDEX access_list_element_address_index ON eth.access_list_elements USING btree (address); -CREATE INDEX access_list_storage_keys_index ON eth.access_list_elements USING gin (storage_keys); - -- log indexes CREATE INDEX log_block_number_index ON eth.log_cids USING btree (block_number); CREATE INDEX log_header_id_index ON eth.log_cids USING btree (header_id); @@ -65,11 +60,6 @@ DROP INDEX eth.log_cid_block_number_index; DROP INDEX eth.log_header_id_index; DROP INDEX eth.log_block_number_index; --- access list indexes -DROP INDEX eth.access_list_storage_keys_index; -DROP INDEX eth.access_list_element_address_index; -DROP INDEX eth.access_list_block_number_index; - -- storage node indexes DROP INDEX eth.storage_removed_index; DROP INDEX eth.storage_header_id_index; diff --git a/db/migrations/00014_create_db_version_table.sql b/db/migrations/00013_create_db_version_table.sql similarity index 100% rename from db/migrations/00014_create_db_version_table.sql rename to db/migrations/00013_create_db_version_table.sql diff --git a/db/migrations/00015_create_eth_meta_schema.sql b/db/migrations/00014_create_eth_meta_schema.sql similarity index 100% rename from db/migrations/00015_create_eth_meta_schema.sql rename to db/migrations/00014_create_eth_meta_schema.sql diff --git a/db/migrations/00016_create_watched_addresses_table.sql b/db/migrations/00015_create_watched_addresses_table.sql similarity index 100% rename from db/migrations/00016_create_watched_addresses_table.sql rename to db/migrations/00015_create_watched_addresses_table.sql diff --git a/db/migrations/00017_create_stored_functions.sql b/db/migrations/00016_create_stored_functions.sql similarity index 100% rename from db/migrations/00017_create_stored_functions.sql rename to db/migrations/00016_create_stored_functions.sql diff --git a/db/migrations/00018_convert_to_hypertables.sql b/db/migrations/00017_convert_to_hypertables.sql similarity index 88% rename from db/migrations/00018_convert_to_hypertables.sql rename to db/migrations/00017_convert_to_hypertables.sql index eef0cb1..ed38675 100644 --- a/db/migrations/00018_convert_to_hypertables.sql +++ b/db/migrations/00017_convert_to_hypertables.sql @@ -6,7 +6,6 @@ SELECT create_hypertable('eth.transaction_cids', 'block_number', migrate_data => SELECT create_hypertable('eth.receipt_cids', 'block_number', migrate_data => true, chunk_time_interval => 32768); SELECT create_hypertable('eth.state_cids', 'block_number', migrate_data => true, chunk_time_interval => 32768); SELECT create_hypertable('eth.storage_cids', 'block_number', migrate_data => true, chunk_time_interval => 32768); -SELECT create_hypertable('eth.access_list_elements', 'block_number', migrate_data => true, chunk_time_interval => 32768); SELECT create_hypertable('eth.log_cids', 'block_number', migrate_data => true, chunk_time_interval => 32768); -- update version @@ -20,7 +19,6 @@ INSERT INTO public.db_version (singleton, version) VALUES (true, 'v5.0.0') -- reversing conversion to hypertable requires migrating all data from every chunk back to a single table -- create new regular tables CREATE TABLE eth.log_cids_i (LIKE eth.log_cids INCLUDING ALL); -CREATE TABLE eth.access_list_elements_i (LIKE eth.access_list_elements INCLUDING ALL); CREATE TABLE eth.storage_cids_i (LIKE eth.storage_cids INCLUDING ALL); CREATE TABLE eth.state_cids_i (LIKE eth.state_cids INCLUDING ALL); CREATE TABLE eth.receipt_cids_i (LIKE eth.receipt_cids INCLUDING ALL); @@ -31,7 +29,6 @@ CREATE TABLE ipld.blocks_i (LIKE ipld.blocks INCLUDING ALL); -- migrate data INSERT INTO eth.log_cids_i (SELECT * FROM eth.log_cids); -INSERT INTO eth.access_list_elements_i (SELECT * FROM eth.access_list_elements); INSERT INTO eth.storage_cids_i (SELECT * FROM eth.storage_cids); INSERT INTO eth.state_cids_i (SELECT * FROM eth.state_cids); INSERT INTO eth.receipt_cids_i (SELECT * FROM eth.receipt_cids); @@ -42,7 +39,6 @@ INSERT INTO ipld.blocks_i (SELECT * FROM ipld.blocks); -- drop hypertables DROP TABLE eth.log_cids; -DROP TABLE eth.access_list_elements; DROP TABLE eth.storage_cids; DROP TABLE eth.state_cids; DROP TABLE eth.receipt_cids; @@ -53,7 +49,6 @@ DROP TABLE ipld.blocks; -- rename new tables ALTER TABLE eth.log_cids_i RENAME TO log_cids; -ALTER TABLE eth.access_list_elements_i RENAME TO access_list_elements; ALTER TABLE eth.storage_cids_i RENAME TO storage_cids; ALTER TABLE eth.state_cids_i RENAME TO state_cids; ALTER TABLE eth.receipt_cids_i RENAME TO receipt_cids;