diff --git a/db/migrations/1508943247_create_blocks_table.down.sql b/db/migrations/1508943247_create_blocks_table.down.sql deleted file mode 100644 index 8ea49617..00000000 --- a/db/migrations/1508943247_create_blocks_table.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE public.blocks diff --git a/db/migrations/1508943247_create_blocks_table.up.sql b/db/migrations/1508943247_create_blocks_table.up.sql deleted file mode 100644 index 398bc2c7..00000000 --- a/db/migrations/1508943247_create_blocks_table.up.sql +++ /dev/null @@ -1,4 +0,0 @@ -CREATE TABLE public.blocks -( - block_number BIGINT -) diff --git a/db/migrations/1508965325_add_columns_to_blocks.down.sql b/db/migrations/1508965325_add_columns_to_blocks.down.sql deleted file mode 100644 index 7624ef13..00000000 --- a/db/migrations/1508965325_add_columns_to_blocks.down.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE blocks - DROP COLUMN block_gaslimit, - DROP COLUMN block_gasused, - DROP COLUMN block_time; - diff --git a/db/migrations/1509119369_initial_transaction_table.down.sql b/db/migrations/1509119369_initial_transaction_table.down.sql deleted file mode 100644 index bd4e7b76..00000000 --- a/db/migrations/1509119369_initial_transaction_table.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE transactions \ No newline at end of file diff --git a/db/migrations/1509391861_add_primary_key_to_blocks.down.sql b/db/migrations/1509391861_add_primary_key_to_blocks.down.sql deleted file mode 100644 index 8840f9d2..00000000 --- a/db/migrations/1509391861_add_primary_key_to_blocks.down.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE blocks DROP id \ No newline at end of file diff --git a/db/migrations/1509391861_add_primary_key_to_blocks.up.sql b/db/migrations/1509391861_add_primary_key_to_blocks.up.sql deleted file mode 100644 index e2b68955..00000000 --- a/db/migrations/1509391861_add_primary_key_to_blocks.up.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE blocks ADD COLUMN id SERIAL PRIMARY KEY \ No newline at end of file diff --git a/db/migrations/1509460207_add_block_id_to_transactions.down.sql b/db/migrations/1509460207_add_block_id_to_transactions.down.sql deleted file mode 100644 index ef380fe4..00000000 --- a/db/migrations/1509460207_add_block_id_to_transactions.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE transactions - DROP COLUMN block_id \ No newline at end of file diff --git a/db/migrations/1509484288_add_block_index.down.sql b/db/migrations/1509484288_add_block_index.down.sql deleted file mode 100644 index 9a1d42fb..00000000 --- a/db/migrations/1509484288_add_block_index.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP INDEX block_number_index; \ No newline at end of file diff --git a/db/migrations/1509484288_add_block_index.up.sql b/db/migrations/1509484288_add_block_index.up.sql deleted file mode 100644 index a4710b9c..00000000 --- a/db/migrations/1509484288_add_block_index.up.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX block_number_index ON blocks (block_number); diff --git a/db/migrations/1509633481_add_blocks_columns.down.sql b/db/migrations/1509633481_add_blocks_columns.down.sql deleted file mode 100644 index 74f2f396..00000000 --- a/db/migrations/1509633481_add_blocks_columns.down.sql +++ /dev/null @@ -1,7 +0,0 @@ -ALTER TABLE blocks - Drop COLUMN block_difficulty, - Drop COLUMN block_hash, - drop COLUMN block_nonce, - drop COLUMN block_parenthash, - drop COLUMN block_size, - drop COLUMN uncle_hash \ No newline at end of file diff --git a/db/migrations/1510257608_add_contracts_table.down.sql b/db/migrations/1510257608_add_contracts_table.down.sql deleted file mode 100644 index 3762ad16..00000000 --- a/db/migrations/1510257608_add_contracts_table.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE watched_contracts \ No newline at end of file diff --git a/db/migrations/1510262915_add_from_to_transactions.down.sql b/db/migrations/1510262915_add_from_to_transactions.down.sql deleted file mode 100644 index 1f323136..00000000 --- a/db/migrations/1510262915_add_from_to_transactions.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE transactions - DROP COLUMN tx_from diff --git a/db/migrations/1510262915_add_from_to_transactions.up.sql b/db/migrations/1510262915_add_from_to_transactions.up.sql deleted file mode 100644 index 2222e866..00000000 --- a/db/migrations/1510262915_add_from_to_transactions.up.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE transactions - ADD COLUMN tx_from VARCHAR(66) diff --git a/db/migrations/1512417153_add_abi_to_watched_contracts.down.sql b/db/migrations/1512417153_add_abi_to_watched_contracts.down.sql deleted file mode 100644 index e22ac41f..00000000 --- a/db/migrations/1512417153_add_abi_to_watched_contracts.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE watched_contracts - DROP COLUMN contract_abi; \ No newline at end of file diff --git a/db/migrations/1512417153_add_abi_to_watched_contracts.up.sql b/db/migrations/1512417153_add_abi_to_watched_contracts.up.sql deleted file mode 100644 index 4212ee9f..00000000 --- a/db/migrations/1512417153_add_abi_to_watched_contracts.up.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE watched_contracts - ADD COLUMN contract_abi json; \ No newline at end of file diff --git a/db/migrations/1512504078_add_nodes_table.down.sql b/db/migrations/1512504078_add_nodes_table.down.sql deleted file mode 100644 index c095b945..00000000 --- a/db/migrations/1512504078_add_nodes_table.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE nodes; \ No newline at end of file diff --git a/db/migrations/1512507280_add_node_fk_to_blocks.down.sql b/db/migrations/1512507280_add_node_fk_to_blocks.down.sql deleted file mode 100644 index 97e87635..00000000 --- a/db/migrations/1512507280_add_node_fk_to_blocks.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE blocks - DROP COLUMN node_id; \ No newline at end of file diff --git a/db/migrations/1512507280_add_node_fk_to_blocks.up.sql b/db/migrations/1512507280_add_node_fk_to_blocks.up.sql deleted file mode 100644 index 6e03577c..00000000 --- a/db/migrations/1512507280_add_node_fk_to_blocks.up.sql +++ /dev/null @@ -1,5 +0,0 @@ -ALTER TABLE blocks - ADD COLUMN node_id INTEGER NOT NULL, - ADD CONSTRAINT node_fk -FOREIGN KEY (node_id) -REFERENCES nodes (id); \ No newline at end of file diff --git a/db/migrations/1512595007_add_contract_hash_constraint_to_watched_contracts.down.sql b/db/migrations/1512595007_add_contract_hash_constraint_to_watched_contracts.down.sql deleted file mode 100644 index 70672822..00000000 --- a/db/migrations/1512595007_add_contract_hash_constraint_to_watched_contracts.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE watched_contracts - DROP CONSTRAINT contract_hash_uc; \ No newline at end of file diff --git a/db/migrations/1512595007_add_contract_hash_constraint_to_watched_contracts.up.sql b/db/migrations/1512595007_add_contract_hash_constraint_to_watched_contracts.up.sql deleted file mode 100644 index f27a54c0..00000000 --- a/db/migrations/1512595007_add_contract_hash_constraint_to_watched_contracts.up.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE watched_contracts - ADD CONSTRAINT contract_hash_uc UNIQUE (contract_hash); diff --git a/db/migrations/1513029953_add_logs_table.down.sql b/db/migrations/1513029953_add_logs_table.down.sql deleted file mode 100644 index c3866786..00000000 --- a/db/migrations/1513029953_add_logs_table.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE logs; \ No newline at end of file diff --git a/db/migrations/1513192766_add_cascade_delete_to_transactions.down.sql b/db/migrations/1513192766_add_cascade_delete_to_transactions.down.sql deleted file mode 100644 index 6546f2be..00000000 --- a/db/migrations/1513192766_add_cascade_delete_to_transactions.down.sql +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN; - -ALTER TABLE transactions - DROP CONSTRAINT blocks_fk; - -ALTER TABLE transactions - ADD CONSTRAINT fk_test -FOREIGN KEY (block_id) -REFERENCES blocks (id); - -COMMIT; \ No newline at end of file diff --git a/db/migrations/1513192766_add_cascade_delete_to_transactions.up.sql b/db/migrations/1513192766_add_cascade_delete_to_transactions.up.sql deleted file mode 100644 index 50ca360c..00000000 --- a/db/migrations/1513192766_add_cascade_delete_to_transactions.up.sql +++ /dev/null @@ -1,12 +0,0 @@ -BEGIN; - -ALTER TABLE transactions - DROP CONSTRAINT fk_test; - -ALTER TABLE transactions - ADD CONSTRAINT blocks_fk -FOREIGN KEY (block_id) -REFERENCES blocks (id) -ON DELETE CASCADE; - -COMMIT; diff --git a/db/migrations/1513275969_add_cascade_delete_to_blocks.up.sql b/db/migrations/1513275969_add_cascade_delete_to_blocks.up.sql deleted file mode 100644 index 37ee1f18..00000000 --- a/db/migrations/1513275969_add_cascade_delete_to_blocks.up.sql +++ /dev/null @@ -1,12 +0,0 @@ -BEGIN; - -ALTER TABLE blocks - DROP CONSTRAINT node_fk; - -ALTER TABLE blocks - ADD CONSTRAINT node_fk -FOREIGN KEY (node_id) -REFERENCES nodes (id) -ON DELETE CASCADE; - -COMMIT; \ No newline at end of file diff --git a/db/migrations/1513613036_add_is_final_to_blocks.down.sql b/db/migrations/1513613036_add_is_final_to_blocks.down.sql deleted file mode 100644 index 5a0b113c..00000000 --- a/db/migrations/1513613036_add_is_final_to_blocks.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE blocks - DROP COLUMN is_final; \ No newline at end of file diff --git a/db/migrations/1513613036_add_is_final_to_blocks.up.sql b/db/migrations/1513613036_add_is_final_to_blocks.up.sql deleted file mode 100644 index 667954ed..00000000 --- a/db/migrations/1513613036_add_is_final_to_blocks.up.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE blocks - ADD COLUMN is_final BOOLEAN; \ No newline at end of file diff --git a/db/migrations/1513781105_add_unique_constraint_blocks_node.down.sql b/db/migrations/1513781105_add_unique_constraint_blocks_node.down.sql deleted file mode 100644 index d72b7e91..00000000 --- a/db/migrations/1513781105_add_unique_constraint_blocks_node.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE blocks - DROP CONSTRAINT node_id_block_number_uc; \ No newline at end of file diff --git a/db/migrations/1513781105_add_unique_constraint_blocks_node.up.sql b/db/migrations/1513781105_add_unique_constraint_blocks_node.up.sql deleted file mode 100644 index 99c9293c..00000000 --- a/db/migrations/1513781105_add_unique_constraint_blocks_node.up.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE blocks - ADD CONSTRAINT node_id_block_number_uc UNIQUE (block_number, node_id); \ No newline at end of file diff --git a/db/migrations/1513783615_add_block_id_index_on_transactions_table.down.sql b/db/migrations/1513783615_add_block_id_index_on_transactions_table.down.sql deleted file mode 100644 index 214e4604..00000000 --- a/db/migrations/1513783615_add_block_id_index_on_transactions_table.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP INDEX block_id_index; \ No newline at end of file diff --git a/db/migrations/1513783615_add_block_id_index_on_transactions_table.up.sql b/db/migrations/1513783615_add_block_id_index_on_transactions_table.up.sql deleted file mode 100644 index 1e375eec..00000000 --- a/db/migrations/1513783615_add_block_id_index_on_transactions_table.up.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX block_id_index ON transactions (block_id); \ No newline at end of file diff --git a/db/migrations/1513783944_add_node_id_index_on_blocks_table.down.sql b/db/migrations/1513783944_add_node_id_index_on_blocks_table.down.sql deleted file mode 100644 index f8621c94..00000000 --- a/db/migrations/1513783944_add_node_id_index_on_blocks_table.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP INDEX node_id_index; \ No newline at end of file diff --git a/db/migrations/1513783944_add_node_id_index_on_blocks_table.up.sql b/db/migrations/1513783944_add_node_id_index_on_blocks_table.up.sql deleted file mode 100644 index a60623a4..00000000 --- a/db/migrations/1513783944_add_node_id_index_on_blocks_table.up.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX node_id_index ON blocks (node_id); \ No newline at end of file diff --git a/db/migrations/1513805096_tx_to_index.down.sql b/db/migrations/1513805096_tx_to_index.down.sql deleted file mode 100644 index cd501119..00000000 --- a/db/migrations/1513805096_tx_to_index.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP INDEX tx_to_index; \ No newline at end of file diff --git a/db/migrations/1513805096_tx_to_index.up.sql b/db/migrations/1513805096_tx_to_index.up.sql deleted file mode 100644 index d51eb6f2..00000000 --- a/db/migrations/1513805096_tx_to_index.up.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX tx_to_index ON transactions(tx_to); \ No newline at end of file diff --git a/db/migrations/1513805100_tx_from_index.down.sql b/db/migrations/1513805100_tx_from_index.down.sql deleted file mode 100644 index 5e0d00a0..00000000 --- a/db/migrations/1513805100_tx_from_index.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP INDEX tx_from_index; \ No newline at end of file diff --git a/db/migrations/1513805100_tx_from_index.up.sql b/db/migrations/1513805100_tx_from_index.up.sql deleted file mode 100644 index d56c117d..00000000 --- a/db/migrations/1513805100_tx_from_index.up.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX tx_from_index ON transactions(tx_from); \ No newline at end of file diff --git a/db/migrations/1514392444_add_miner.down.sql b/db/migrations/1514392444_add_miner.down.sql deleted file mode 100644 index 417ad684..00000000 --- a/db/migrations/1514392444_add_miner.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE blocks - DROP COLUMN block_miner; \ No newline at end of file diff --git a/db/migrations/1514392444_add_miner.up.sql b/db/migrations/1514392444_add_miner.up.sql deleted file mode 100644 index 2667365b..00000000 --- a/db/migrations/1514392444_add_miner.up.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE blocks - ADD COLUMN block_miner VARCHAR(42); \ No newline at end of file diff --git a/db/migrations/1514397430_add_extra_data.down.sql b/db/migrations/1514397430_add_extra_data.down.sql deleted file mode 100644 index 0da3cdeb..00000000 --- a/db/migrations/1514397430_add_extra_data.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE blocks - DROP COLUMN block_extra_data; \ No newline at end of file diff --git a/db/migrations/1514397430_add_extra_data.up.sql b/db/migrations/1514397430_add_extra_data.up.sql deleted file mode 100644 index 71839271..00000000 --- a/db/migrations/1514397430_add_extra_data.up.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE blocks - ADD COLUMN block_extra_data VARCHAR; \ No newline at end of file diff --git a/db/migrations/1514476024_add_block_reward_uncle_reward.down.sql b/db/migrations/1514476024_add_block_reward_uncle_reward.down.sql deleted file mode 100644 index ec96263f..00000000 --- a/db/migrations/1514476024_add_block_reward_uncle_reward.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE blocks - DROP COLUMN block_reward, - DROP COLUMN block_uncles_reward; diff --git a/db/migrations/1514476024_add_block_reward_uncle_reward.up.sql b/db/migrations/1514476024_add_block_reward_uncle_reward.up.sql deleted file mode 100644 index 447e53a6..00000000 --- a/db/migrations/1514476024_add_block_reward_uncle_reward.up.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE blocks - ADD COLUMN block_reward NUMERIC, - ADD COLUMN block_uncles_reward NUMERIC; diff --git a/db/migrations/1514502281_add_data_input_to_transactions.down.sql b/db/migrations/1514502281_add_data_input_to_transactions.down.sql deleted file mode 100644 index cbaddf86..00000000 --- a/db/migrations/1514502281_add_data_input_to_transactions.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE transactions - DROP COLUMN tx_input_data; \ No newline at end of file diff --git a/db/migrations/1514502281_add_data_input_to_transactions.up.sql b/db/migrations/1514502281_add_data_input_to_transactions.up.sql deleted file mode 100644 index 963d0c75..00000000 --- a/db/migrations/1514502281_add_data_input_to_transactions.up.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE transactions - ADD COLUMN tx_input_data VARCHAR; \ No newline at end of file diff --git a/db/migrations/1514564898_create_receipts_table.down.sql b/db/migrations/1514564898_create_receipts_table.down.sql deleted file mode 100644 index 4009cc9f..00000000 --- a/db/migrations/1514564898_create_receipts_table.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP TABLE receipts; - diff --git a/db/migrations/1514932205_add_transaction_id_index_to_receipts.down.sql b/db/migrations/1514932205_add_transaction_id_index_to_receipts.down.sql deleted file mode 100644 index 7fbd62b2..00000000 --- a/db/migrations/1514932205_add_transaction_id_index_to_receipts.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP INDEX transaction_id_index; diff --git a/db/migrations/1514932205_add_transaction_id_index_to_receipts.up.sql b/db/migrations/1514932205_add_transaction_id_index_to_receipts.up.sql deleted file mode 100644 index 5ae39214..00000000 --- a/db/migrations/1514932205_add_transaction_id_index_to_receipts.up.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX transaction_id_index ON receipts (transaction_id); \ No newline at end of file diff --git a/db/migrations/1515613181_add_fields_to_node.down.sql b/db/migrations/1515613181_add_fields_to_node.down.sql deleted file mode 100644 index 66ffb290..00000000 --- a/db/migrations/1515613181_add_fields_to_node.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE nodes - DROP COLUMN node_id, - DROP COLUMN client_name; \ No newline at end of file diff --git a/db/migrations/1515613181_add_fields_to_node.up.sql b/db/migrations/1515613181_add_fields_to_node.up.sql deleted file mode 100644 index 5396e26a..00000000 --- a/db/migrations/1515613181_add_fields_to_node.up.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE nodes - ADD COLUMN node_id VARCHAR(128), - ADD COLUMN client_name VARCHAR; \ No newline at end of file diff --git a/db/migrations/1515613715_update_node_index.down.sql b/db/migrations/1515613715_update_node_index.down.sql deleted file mode 100644 index 5c252c4b..00000000 --- a/db/migrations/1515613715_update_node_index.down.sql +++ /dev/null @@ -1,9 +0,0 @@ -BEGIN; - -ALTER TABLE nodes - DROP CONSTRAINT node_uc; - -ALTER TABLE nodes - ADD CONSTRAINT node_uc UNIQUE (genesis_block, network_id); - -COMMIT; diff --git a/db/migrations/1515613715_update_node_index.up.sql b/db/migrations/1515613715_update_node_index.up.sql deleted file mode 100644 index 6abf9347..00000000 --- a/db/migrations/1515613715_update_node_index.up.sql +++ /dev/null @@ -1,9 +0,0 @@ -BEGIN; - -ALTER TABLE nodes - DROP CONSTRAINT node_uc; - -ALTER TABLE nodes - ADD CONSTRAINT node_uc UNIQUE (genesis_block, network_id, node_id); - -COMMIT; \ No newline at end of file diff --git a/db/migrations/1516050071_add_log_fk_constraint.down.sql b/db/migrations/1516050071_add_log_fk_constraint.down.sql deleted file mode 100644 index 55779b51..00000000 --- a/db/migrations/1516050071_add_log_fk_constraint.down.sql +++ /dev/null @@ -1,12 +0,0 @@ -BEGIN; - -ALTER TABLE logs - DROP CONSTRAINT receipts_fk; - -ALTER TABLE logs - DROP COLUMN receipt_id; - -ALTER TABLE logs - ADD CONSTRAINT log_uc UNIQUE (block_number, index); - -COMMIT; \ No newline at end of file diff --git a/db/migrations/1516648743_add_log_filters.down.sql b/db/migrations/1516648743_add_log_filters.down.sql deleted file mode 100644 index a28adeee..00000000 --- a/db/migrations/1516648743_add_log_filters.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE log_filters; \ No newline at end of file diff --git a/db/migrations/1516653373_add_watched_event_logs.down.sql b/db/migrations/1516653373_add_watched_event_logs.down.sql deleted file mode 100644 index 294d7bfe..00000000 --- a/db/migrations/1516653373_add_watched_event_logs.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -DROP VIEW watched_event_logs; -DROP VIEW block_stats; diff --git a/db/migrations/1517538273_update_gas_limit_gas_used.down.sql b/db/migrations/1517538273_update_gas_limit_gas_used.down.sql deleted file mode 100644 index 1bdce02f..00000000 --- a/db/migrations/1517538273_update_gas_limit_gas_used.down.sql +++ /dev/null @@ -1,17 +0,0 @@ -BEGIN; -ALTER TABLE blocks - ALTER COLUMN block_gaslimit TYPE DOUBLE PRECISION USING block_gaslimit :: DOUBLE PRECISION; - -ALTER TABLE blocks - ALTER COLUMN block_gasused TYPE DOUBLE PRECISION USING block_gasused :: DOUBLE PRECISION; - -ALTER TABLE blocks - ALTER COLUMN block_time TYPE DOUBLE PRECISION USING block_time :: DOUBLE PRECISION; - -ALTER TABLE blocks - ALTER COLUMN block_reward TYPE NUMERIC USING block_time :: NUMERIC; - -ALTER TABLE blocks - ALTER COLUMN block_uncles_reward TYPE NUMERIC USING block_time :: NUMERIC; - -COMMIT; \ No newline at end of file diff --git a/db/migrations/1517538273_update_gas_limit_gas_used.up.sql b/db/migrations/1517538273_update_gas_limit_gas_used.up.sql deleted file mode 100644 index 7426a59b..00000000 --- a/db/migrations/1517538273_update_gas_limit_gas_used.up.sql +++ /dev/null @@ -1,17 +0,0 @@ -BEGIN; -ALTER TABLE blocks - ALTER COLUMN block_gaslimit TYPE BIGINT USING block_gaslimit :: BIGINT; - -ALTER TABLE blocks - ALTER COLUMN block_gasused TYPE BIGINT USING block_gasused :: BIGINT; - -ALTER TABLE blocks - ALTER COLUMN block_time TYPE BIGINT USING block_time :: BIGINT; - -ALTER TABLE blocks - ALTER COLUMN block_reward TYPE DOUBLE PRECISION USING block_time :: DOUBLE PRECISION; - -ALTER TABLE blocks - ALTER COLUMN block_uncles_reward TYPE DOUBLE PRECISION USING block_time :: DOUBLE PRECISION; - -COMMIT; diff --git a/db/migrations/1517603663_rename_block_columns.down.sql b/db/migrations/1517603663_rename_block_columns.down.sql deleted file mode 100644 index 6993a276..00000000 --- a/db/migrations/1517603663_rename_block_columns.down.sql +++ /dev/null @@ -1,40 +0,0 @@ -BEGIN; -ALTER TABLE blocks - RENAME COLUMN number TO block_number; - -ALTER TABLE blocks - RENAME COLUMN gaslimit TO block_gaslimit; - -ALTER TABLE blocks - RENAME COLUMN gasused TO block_gasused; - -ALTER TABLE blocks - RENAME COLUMN TIME TO block_time; - -ALTER TABLE blocks - RENAME COLUMN difficulty TO block_difficulty; - -ALTER TABLE blocks - RENAME COLUMN HASH TO block_hash; - -ALTER TABLE blocks - RENAME COLUMN nonce TO block_nonce; - -ALTER TABLE blocks - RENAME COLUMN parenthash TO block_parenthash; - -ALTER TABLE blocks - RENAME COLUMN size TO block_size; - -ALTER TABLE blocks - RENAME COLUMN miner TO block_miner; - -ALTER TABLE blocks - RENAME COLUMN extra_data TO block_extra_data; - -ALTER TABLE blocks - RENAME COLUMN reward TO block_reward; - -ALTER TABLE blocks - RENAME COLUMN uncles_reward TO block_uncles_reward; -COMMIT; \ No newline at end of file diff --git a/db/migrations/1517603663_rename_block_columns.up.sql b/db/migrations/1517603663_rename_block_columns.up.sql deleted file mode 100644 index cbd572cf..00000000 --- a/db/migrations/1517603663_rename_block_columns.up.sql +++ /dev/null @@ -1,50 +0,0 @@ -BEGIN; -ALTER TABLE blocks - RENAME COLUMN block_number TO number; - -ALTER TABLE blocks - RENAME COLUMN block_gaslimit TO gaslimit; - -ALTER TABLE blocks - RENAME COLUMN block_gasused TO gasused; - -ALTER TABLE blocks - RENAME COLUMN block_time TO time; - -ALTER TABLE blocks - RENAME COLUMN block_difficulty TO difficulty; - -ALTER TABLE blocks - RENAME COLUMN block_hash TO hash; - -ALTER TABLE blocks - RENAME COLUMN block_nonce TO nonce; - -ALTER TABLE blocks - RENAME COLUMN block_parenthash TO parenthash; - -ALTER TABLE blocks - RENAME COLUMN block_size TO size; - -ALTER TABLE blocks - RENAME COLUMN block_miner TO miner; - -ALTER TABLE blocks - RENAME COLUMN block_extra_data TO extra_data; - -ALTER TABLE blocks - RENAME COLUMN block_reward TO reward; - -ALTER TABLE blocks - RENAME COLUMN block_uncles_reward TO uncles_reward; -COMMIT; - - - - - - - - - - diff --git a/db/migrations/1517605676_update_tx_table_names.down.sql b/db/migrations/1517605676_update_tx_table_names.down.sql deleted file mode 100644 index f2060aae..00000000 --- a/db/migrations/1517605676_update_tx_table_names.down.sql +++ /dev/null @@ -1,19 +0,0 @@ -BEGIN; -ALTER TABLE transactions - RENAME COLUMN hash TO tx_hash; - -ALTER TABLE transactions - RENAME COLUMN nonce TO tx_nonce; - -ALTER TABLE transactions - RENAME COLUMN gaslimit TO tx_gaslimit; - -ALTER TABLE transactions - RENAME COLUMN gasprice TO tx_gasprice; - -ALTER TABLE transactions - RENAME COLUMN value TO tx_value; - -ALTER TABLE transactions - RENAME COLUMN input_data TO tx_input_data; -COMMIT; diff --git a/db/migrations/1517605676_update_tx_table_names.up.sql b/db/migrations/1517605676_update_tx_table_names.up.sql deleted file mode 100644 index 316fc593..00000000 --- a/db/migrations/1517605676_update_tx_table_names.up.sql +++ /dev/null @@ -1,19 +0,0 @@ -BEGIN; -ALTER TABLE transactions - RENAME COLUMN tx_hash TO hash; - -ALTER TABLE transactions - RENAME COLUMN tx_nonce TO nonce; - -ALTER TABLE transactions - RENAME COLUMN tx_gaslimit TO gaslimit; - -ALTER TABLE transactions - RENAME COLUMN tx_gasprice TO gasprice; - -ALTER TABLE transactions - RENAME COLUMN tx_value TO value; - -ALTER TABLE transactions - RENAME COLUMN tx_input_data TO input_data; -COMMIT; diff --git a/db/migrations/1517854395_update_log_filters_to_block_constraint.down.sql b/db/migrations/1517854395_update_log_filters_to_block_constraint.down.sql deleted file mode 100644 index 253d5849..00000000 --- a/db/migrations/1517854395_update_log_filters_to_block_constraint.down.sql +++ /dev/null @@ -1,7 +0,0 @@ -BEGIN; -ALTER TABLE log_filters - DROP CONSTRAINT log_filters_to_block_check; - -ALTER TABLE log_filters - ADD CONSTRAINT log_filters_from_block_check1 CHECK (to_block >= 0); -COMMIT; \ No newline at end of file diff --git a/db/migrations/1517854395_update_log_filters_to_block_constraint.up.sql b/db/migrations/1517854395_update_log_filters_to_block_constraint.up.sql deleted file mode 100644 index 32fa00cb..00000000 --- a/db/migrations/1517854395_update_log_filters_to_block_constraint.up.sql +++ /dev/null @@ -1,7 +0,0 @@ -BEGIN; -ALTER TABLE log_filters - DROP CONSTRAINT log_filters_from_block_check1; - -ALTER TABLE log_filters - ADD CONSTRAINT log_filters_to_block_check CHECK (to_block >= 0); -COMMIT; diff --git a/db/migrations/1520289493_update_eth18_types.down.sql b/db/migrations/1520289493_update_eth18_types.down.sql deleted file mode 100644 index 439f5f9e..00000000 --- a/db/migrations/1520289493_update_eth18_types.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE blocks - ALTER COLUMN size TYPE BIGINT USING size::BIGINT; diff --git a/db/migrations/1520289493_update_eth18_types.up.sql b/db/migrations/1520289493_update_eth18_types.up.sql deleted file mode 100644 index 529fe9c8..00000000 --- a/db/migrations/1520289493_update_eth18_types.up.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE blocks - ALTER COLUMN size TYPE VARCHAR USING size::VARCHAR; diff --git a/db/migrations/1521640994_rename_node_table.down.sql b/db/migrations/1521640994_rename_node_table.down.sql deleted file mode 100644 index 70d459c2..00000000 --- a/db/migrations/1521640994_rename_node_table.down.sql +++ /dev/null @@ -1,23 +0,0 @@ -BEGIN; -ALTER TABLE public.eth_nodes - RENAME TO nodes; - -ALTER TABLE public.nodes - RENAME COLUMN eth_node_id TO node_id; - -ALTER TABLE public.nodes - DROP CONSTRAINT eth_node_uc; -ALTER TABLE public.nodes - ADD CONSTRAINT node_uc UNIQUE (genesis_block, network_id, node_id); - -ALTER TABLE public.blocks RENAME COLUMN eth_node_id TO node_id; - -ALTER TABLE public.blocks DROP CONSTRAINT eth_node_id_block_number_uc; -ALTER TABLE public.blocks - ADD CONSTRAINT node_id_block_number_uc UNIQUE (number, node_id); - -ALTER TABLE public.blocks DROP CONSTRAINT node_fk; -ALTER TABLE public.blocks - ADD CONSTRAINT node_fk -FOREIGN KEY (node_id) REFERENCES nodes (id) ON DELETE CASCADE; -COMMIT; \ No newline at end of file diff --git a/db/migrations/1521640994_rename_node_table.up.sql b/db/migrations/1521640994_rename_node_table.up.sql deleted file mode 100644 index 3b6343c0..00000000 --- a/db/migrations/1521640994_rename_node_table.up.sql +++ /dev/null @@ -1,21 +0,0 @@ -BEGIN; -ALTER TABLE public.nodes RENAME TO eth_nodes; - -ALTER TABLE public.eth_nodes RENAME COLUMN node_id TO eth_node_id; - -ALTER TABLE public.eth_nodes DROP CONSTRAINT node_uc; -ALTER TABLE public.eth_nodes - ADD CONSTRAINT eth_node_uc UNIQUE (genesis_block, network_id, eth_node_id); - -ALTER TABLE public.blocks RENAME COLUMN node_id TO eth_node_id; - -ALTER TABLE public.blocks DROP CONSTRAINT node_id_block_number_uc; -ALTER TABLE public.blocks - ADD CONSTRAINT eth_node_id_block_number_uc UNIQUE (number, eth_node_id); - -ALTER TABLE public.blocks DROP CONSTRAINT node_fk; -ALTER TABLE public.blocks - ADD CONSTRAINT node_fk -FOREIGN KEY (eth_node_id) REFERENCES eth_nodes (id) ON DELETE CASCADE; - -COMMIT; \ No newline at end of file diff --git a/db/migrations/1525122581_associate_receipts_with_blocks.down.sql b/db/migrations/1525122581_associate_receipts_with_blocks.down.sql deleted file mode 100644 index e6ce2266..00000000 --- a/db/migrations/1525122581_associate_receipts_with_blocks.down.sql +++ /dev/null @@ -1,25 +0,0 @@ -BEGIN; - -ALTER TABLE receipts - ADD COLUMN transaction_id INT; - -CREATE INDEX transaction_id_index ON receipts (transaction_id); - -UPDATE receipts - SET transaction_id = ( - SELECT id FROM transactions WHERE transactions.hash = receipts.tx_hash - ); - -ALTER TABLE receipts - ALTER COLUMN transaction_id SET NOT NULL; - -ALTER TABLE receipts - ADD CONSTRAINT transaction_fk -FOREIGN KEY (transaction_id) -REFERENCES transactions (id) -ON DELETE CASCADE; - -ALTER TABLE receipts - DROP COLUMN block_id; - -COMMIT; diff --git a/db/migrations/1525122581_associate_receipts_with_blocks.up.sql b/db/migrations/1525122581_associate_receipts_with_blocks.up.sql deleted file mode 100644 index 51d22747..00000000 --- a/db/migrations/1525122581_associate_receipts_with_blocks.up.sql +++ /dev/null @@ -1,23 +0,0 @@ -BEGIN; - -ALTER TABLE receipts - ADD COLUMN block_id INT; - -UPDATE receipts - SET block_id = ( - SELECT block_id FROM transactions WHERE transactions.id = receipts.transaction_id - ); - -ALTER TABLE receipts - ALTER COLUMN block_id SET NOT NULL; - -ALTER TABLE receipts - ADD CONSTRAINT blocks_fk -FOREIGN KEY (block_id) -REFERENCES blocks (id) -ON DELETE CASCADE; - -ALTER TABLE receipts - DROP COLUMN transaction_id; - -COMMIT; diff --git a/db/migrations/1525464568_add_eth_node_fingerprint_to_blocks.down.sql b/db/migrations/1525464568_add_eth_node_fingerprint_to_blocks.down.sql deleted file mode 100644 index f1980bec..00000000 --- a/db/migrations/1525464568_add_eth_node_fingerprint_to_blocks.down.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE blocks - DROP COLUMN eth_node_fingerprint; \ No newline at end of file diff --git a/db/migrations/1528317902_create_token_supply_table.down.sql b/db/migrations/1528317902_create_token_supply_table.down.sql deleted file mode 100644 index fdc23208..00000000 --- a/db/migrations/1528317902_create_token_supply_table.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE token_supply; \ No newline at end of file diff --git a/db/migrations/1531758090_create_headers_table.down.sql b/db/migrations/1531758090_create_headers_table.down.sql deleted file mode 100644 index d9b283f9..00000000 --- a/db/migrations/1531758090_create_headers_table.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE public.headers; \ No newline at end of file diff --git a/db/migrations/1532468317_create_checked_headers_table.down.sql b/db/migrations/1532468317_create_checked_headers_table.down.sql deleted file mode 100644 index d9bf78df..00000000 --- a/db/migrations/1532468317_create_checked_headers_table.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE public.checked_headers; \ No newline at end of file diff --git a/db/migrations/1532468318_create_maker_schema.down.sql b/db/migrations/1532468318_create_maker_schema.down.sql deleted file mode 100644 index cb59a3da..00000000 --- a/db/migrations/1532468318_create_maker_schema.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP SCHEMA maker; diff --git a/db/migrations/1532468318_create_maker_schema.up.sql b/db/migrations/1532468318_create_maker_schema.up.sql deleted file mode 100644 index 87c8fa51..00000000 --- a/db/migrations/1532468318_create_maker_schema.up.sql +++ /dev/null @@ -1,2 +0,0 @@ -CREATE SCHEMA maker; - diff --git a/db/migrations/1532468319_create_flip_kick.down.sql b/db/migrations/1532468319_create_flip_kick.down.sql deleted file mode 100644 index bde9fdb0..00000000 --- a/db/migrations/1532468319_create_flip_kick.down.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE maker.flip_kick; - -ALTER TABLE public.checked_headers - DROP COLUMN flip_kick_checked; \ No newline at end of file diff --git a/db/migrations/1533844125_create_frob.down.sql b/db/migrations/1533844125_create_frob.down.sql deleted file mode 100644 index 8c8d394e..00000000 --- a/db/migrations/1533844125_create_frob.down.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE maker.frob; - -ALTER TABLE public.checked_headers - DROP COLUMN frob_checked; \ No newline at end of file diff --git a/db/migrations/1534275305_create_price_feeds_table.down.sql b/db/migrations/1534275305_create_price_feeds_table.down.sql deleted file mode 100644 index 98b365c6..00000000 --- a/db/migrations/1534275305_create_price_feeds_table.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE maker.price_feeds; \ No newline at end of file diff --git a/db/migrations/1534295712_create_tend.down.sql b/db/migrations/1534295712_create_tend.down.sql deleted file mode 100644 index d473b29a..00000000 --- a/db/migrations/1534295712_create_tend.down.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE maker.tend; - -ALTER TABLE public.checked_headers - DROP COLUMN tend_checked; \ No newline at end of file diff --git a/db/migrations/1534295713_create_bite.down.sql b/db/migrations/1534295713_create_bite.down.sql deleted file mode 100644 index 3245eedd..00000000 --- a/db/migrations/1534295713_create_bite.down.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE maker.bite; - -ALTER TABLE public.checked_headers - DROP COLUMN bite_checked; \ No newline at end of file diff --git a/db/migrations/1534799167_create_dent.down.sql b/db/migrations/1534799167_create_dent.down.sql deleted file mode 100644 index 54e9430a..00000000 --- a/db/migrations/1534799167_create_dent.down.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE maker.dent; - -ALTER TABLE public.checked_headers - DROP COLUMN dent_checked; \ No newline at end of file diff --git a/db/migrations/1535667935_create_pit_file.down.sql b/db/migrations/1535667935_create_pit_file.down.sql deleted file mode 100644 index 41bb5693..00000000 --- a/db/migrations/1535667935_create_pit_file.down.sql +++ /dev/null @@ -1,12 +0,0 @@ -DROP TABLE maker.pit_file_ilk; -DROP TABLE maker.pit_file_stability_fee; -DROP TABLE maker.pit_file_debt_ceiling; - -ALTER TABLE public.checked_headers - DROP COLUMN pit_file_debt_ceiling_checked; - -ALTER TABLE public.checked_headers - DROP COLUMN pit_file_ilk_checked; - -ALTER TABLE public.checked_headers - DROP COLUMN pit_file_stability_fee_checked; \ No newline at end of file diff --git a/db/migrations/1536267596_create_vat_init.down.sql b/db/migrations/1536267596_create_vat_init.down.sql deleted file mode 100644 index 0d41ae29..00000000 --- a/db/migrations/1536267596_create_vat_init.down.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE maker.vat_init; - -ALTER TABLE public.checked_headers - DROP COLUMN vat_init_checked; \ No newline at end of file diff --git a/db/migrations/1536603967_create_drip_file.down.sql b/db/migrations/1536603967_create_drip_file.down.sql deleted file mode 100644 index 0ee02482..00000000 --- a/db/migrations/1536603967_create_drip_file.down.sql +++ /dev/null @@ -1,12 +0,0 @@ -DROP TABLE maker.drip_file_ilk; -DROP TABLE maker.drip_file_repo; -DROP TABLE maker.drip_file_vow; - -ALTER TABLE public.checked_headers - DROP COLUMN drip_file_ilk_checked; - -ALTER TABLE public.checked_headers - DROP COLUMN drip_file_repo_checked; - -ALTER TABLE public.checked_headers - DROP COLUMN drip_file_vow_checked; \ No newline at end of file diff --git a/db/migrations/1536615440_create_deal.down.sql b/db/migrations/1536615440_create_deal.down.sql deleted file mode 100644 index dc69c192..00000000 --- a/db/migrations/1536615440_create_deal.down.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE maker.deal; - -ALTER TABLE public.checked_headers - DROP COLUMN deal_checked; \ No newline at end of file diff --git a/db/migrations/1536702963_add_price_feed_trigger.down.sql b/db/migrations/1536702963_add_price_feed_trigger.down.sql deleted file mode 100644 index 456f014e..00000000 --- a/db/migrations/1536702963_add_price_feed_trigger.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TRIGGER notify_pricefeeds ON maker.price_feeds; diff --git a/db/migrations/1536710319_create_drip_drip.down.sql b/db/migrations/1536710319_create_drip_drip.down.sql deleted file mode 100644 index cce76663..00000000 --- a/db/migrations/1536710319_create_drip_drip.down.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE maker.drip_drip; - -ALTER TABLE public.checked_headers - DROP COLUMN drip_drip_checked; \ No newline at end of file diff --git a/db/migrations/1536765047_create_cat_file.down.sql b/db/migrations/1536765047_create_cat_file.down.sql deleted file mode 100644 index 6a58fbc1..00000000 --- a/db/migrations/1536765047_create_cat_file.down.sql +++ /dev/null @@ -1,12 +0,0 @@ -DROP TABLE maker.cat_file_chop_lump; -DROP TABLE maker.cat_file_flip; -DROP TABLE maker.cat_file_pit_vow; - -ALTER TABLE public.checked_headers - DROP COLUMN cat_file_chop_lump_checked; - -ALTER TABLE public.checked_headers - DROP COLUMN cat_file_flip_checked; - -ALTER TABLE public.checked_headers - DROP COLUMN cat_file_pit_vow_checked; \ No newline at end of file diff --git a/db/migrations/1536942529_create_flop_kick.down.sql b/db/migrations/1536942529_create_flop_kick.down.sql deleted file mode 100644 index cf042f3e..00000000 --- a/db/migrations/1536942529_create_flop_kick.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE maker.flop_kick; -ALTER TABLE public.checked_headers - DROP COLUMN flop_kick_checked; \ No newline at end of file diff --git a/db/migrations/1538396815_create_vat_move.down.sql b/db/migrations/1538396815_create_vat_move.down.sql deleted file mode 100644 index 2366c0ef..00000000 --- a/db/migrations/1538396815_create_vat_move.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE maker.vat_move; -ALTER TABLE public.checked_headers - DROP COLUMN vat_move_checked; \ No newline at end of file diff --git a/db/migrations/1538510582_create_vat_fold_table.down.sql b/db/migrations/1538510582_create_vat_fold_table.down.sql deleted file mode 100644 index d63b6597..00000000 --- a/db/migrations/1538510582_create_vat_fold_table.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE maker.vat_fold; -ALTER TABLE public.checked_headers - DROP COLUMN vat_fold_checked; diff --git a/db/migrations/1538671228_create_vat_heal.down.sql b/db/migrations/1538671228_create_vat_heal.down.sql deleted file mode 100644 index 20161cab..00000000 --- a/db/migrations/1538671228_create_vat_heal.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE maker.vat_heal; -ALTER TABLE public.checked_headers - DROP COLUMN vat_heal_checked; diff --git a/db/migrations/1538679495_create_vat_toll.down.sql b/db/migrations/1538679495_create_vat_toll.down.sql deleted file mode 100644 index 5c291a92..00000000 --- a/db/migrations/1538679495_create_vat_toll.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE maker.vat_toll; -ALTER TABLE public.checked_headers - DROP COLUMN vat_toll_checked; \ No newline at end of file diff --git a/db/migrations/1538689084_create_vat_tune.down.sql b/db/migrations/1538689084_create_vat_tune.down.sql deleted file mode 100644 index 1d1a34ec..00000000 --- a/db/migrations/1538689084_create_vat_tune.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE maker.vat_tune; -ALTER TABLE public.checked_headers - DROP COLUMN vat_tune_checked; \ No newline at end of file diff --git a/db/migrations/1539033620_create_vat_grab.down.sql b/db/migrations/1539033620_create_vat_grab.down.sql deleted file mode 100644 index eade21a1..00000000 --- a/db/migrations/1539033620_create_vat_grab.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE maker.vat_grab; -ALTER TABLE public.checked_headers - DROP COLUMN vat_grab_checked; \ No newline at end of file diff --git a/db/migrations/1539276289_create_vat_flux_table.down.sql b/db/migrations/1539276289_create_vat_flux_table.down.sql deleted file mode 100644 index c42423f1..00000000 --- a/db/migrations/1539276289_create_vat_flux_table.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE maker.vat_flux; -ALTER TABLE public.checked_headers - DROP COLUMN vat_flux_checked; diff --git a/db/migrations/1539638109_create_vat_slip.down.sql b/db/migrations/1539638109_create_vat_slip.down.sql deleted file mode 100644 index 948c0094..00000000 --- a/db/migrations/1539638109_create_vat_slip.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE maker.vat_slip; -ALTER TABLE public.checked_headers - DROP COLUMN vat_slip_checked; \ No newline at end of file diff --git a/db/migrations/1540297136_create_vow_flog.down.sql b/db/migrations/1540297136_create_vow_flog.down.sql deleted file mode 100644 index bdbd47ec..00000000 --- a/db/migrations/1540297136_create_vow_flog.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE maker.vow_flog; -ALTER TABLE public.checked_headers - DROP COLUMN vow_flog_checked; \ No newline at end of file diff --git a/db/migrations/1541525500_create_flap_kick.down.sql b/db/migrations/1541525500_create_flap_kick.down.sql deleted file mode 100644 index 48d4b5c1..00000000 --- a/db/migrations/1541525500_create_flap_kick.down.sql +++ /dev/null @@ -1,3 +0,0 @@ -DROP TABLE maker.flap_kick; -ALTER TABLE public.checked_headers - DROP COLUMN flap_kick_checked; \ No newline at end of file diff --git a/db/migrations/1542222088_drop_pit_file_stability_fee.up.sql b/db/migrations/1542222088_drop_pit_file_stability_fee.up.sql deleted file mode 100644 index 2d43642d..00000000 --- a/db/migrations/1542222088_drop_pit_file_stability_fee.up.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE maker.pit_file_stability_fee; - -ALTER TABLE public.checked_headers - DROP COLUMN pit_file_stability_fee_checked; diff --git a/db/migrations/20171025165407_create_blocks_table.sql b/db/migrations/20171025165407_create_blocks_table.sql new file mode 100644 index 00000000..3e42ae83 --- /dev/null +++ b/db/migrations/20171025165407_create_blocks_table.sql @@ -0,0 +1,9 @@ +-- +goose Up +CREATE TABLE public.blocks +( + block_number BIGINT +) + + +-- +goose Down +DROP TABLE public.blocks diff --git a/db/migrations/1508965325_add_columns_to_blocks.up.sql b/db/migrations/20171025230205_add_columns_to_blocks.sql similarity index 52% rename from db/migrations/1508965325_add_columns_to_blocks.up.sql rename to db/migrations/20171025230205_add_columns_to_blocks.sql index 65c6262e..4d6626ab 100644 --- a/db/migrations/1508965325_add_columns_to_blocks.up.sql +++ b/db/migrations/20171025230205_add_columns_to_blocks.sql @@ -1,4 +1,13 @@ +-- +goose Up ALTER TABLE blocks ADD COLUMN block_gaslimit DOUBLE PRECISION, ADD COLUMN block_gasused DOUBLE PRECISION, ADD COLUMN block_time DOUBLE PRECISION; + + +-- +goose Down +ALTER TABLE blocks + DROP COLUMN block_gaslimit, + DROP COLUMN block_gasused, + DROP COLUMN block_time; + diff --git a/db/migrations/1509119369_initial_transaction_table.up.sql b/db/migrations/20171027174929_initial_transaction_table.sql similarity index 77% rename from db/migrations/1509119369_initial_transaction_table.up.sql rename to db/migrations/20171027174929_initial_transaction_table.sql index d73b09fe..e4cfafe5 100644 --- a/db/migrations/1509119369_initial_transaction_table.up.sql +++ b/db/migrations/20171027174929_initial_transaction_table.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE transactions ( id SERIAL PRIMARY KEY, @@ -7,4 +8,7 @@ CREATE TABLE transactions tx_gaslimit NUMERIC, tx_gasprice NUMERIC, tx_value NUMERIC -) \ No newline at end of file +) + +-- +goose Down +DROP TABLE transactions \ No newline at end of file diff --git a/db/migrations/20171030203101_add_primary_key_to_blocks.sql b/db/migrations/20171030203101_add_primary_key_to_blocks.sql new file mode 100644 index 00000000..274cd918 --- /dev/null +++ b/db/migrations/20171030203101_add_primary_key_to_blocks.sql @@ -0,0 +1,5 @@ +-- +goose Up +ALTER TABLE blocks ADD COLUMN id SERIAL PRIMARY KEY + +-- +goose Down +ALTER TABLE blocks DROP id \ No newline at end of file diff --git a/db/migrations/1509460207_add_block_id_to_transactions.up.sql b/db/migrations/20171031153007_add_block_id_to_transactions.sql similarity index 64% rename from db/migrations/1509460207_add_block_id_to_transactions.up.sql rename to db/migrations/20171031153007_add_block_id_to_transactions.sql index 0132dbc7..7e782019 100644 --- a/db/migrations/1509460207_add_block_id_to_transactions.up.sql +++ b/db/migrations/20171031153007_add_block_id_to_transactions.sql @@ -1,5 +1,11 @@ +-- +goose Up ALTER TABLE transactions ADD COLUMN block_id INTEGER NOT NULL, ADD CONSTRAINT fk_test FOREIGN KEY (block_id) REFERENCES blocks (id) + + +-- +goose Down +ALTER TABLE transactions + DROP COLUMN block_id \ No newline at end of file diff --git a/db/migrations/20171031221128_add_block_index.sql b/db/migrations/20171031221128_add_block_index.sql new file mode 100644 index 00000000..3dde5477 --- /dev/null +++ b/db/migrations/20171031221128_add_block_index.sql @@ -0,0 +1,6 @@ +-- +goose Up +CREATE INDEX block_number_index ON blocks (block_number); + + +-- +goose Down +DROP INDEX block_number_index; \ No newline at end of file diff --git a/db/migrations/1509633481_add_blocks_columns.up.sql b/db/migrations/20171102153801_add_blocks_columns.sql similarity index 52% rename from db/migrations/1509633481_add_blocks_columns.up.sql rename to db/migrations/20171102153801_add_blocks_columns.sql index d373b00f..0cca77a5 100644 --- a/db/migrations/1509633481_add_blocks_columns.up.sql +++ b/db/migrations/20171102153801_add_blocks_columns.sql @@ -1,3 +1,4 @@ +-- +goose Up ALTER TABLE blocks ADD COLUMN block_difficulty BIGINT, ADD COLUMN block_hash VARCHAR(66), @@ -5,3 +6,13 @@ ALTER TABLE blocks ADD COLUMN block_parenthash VARCHAR(66), ADD COLUMN block_size BIGINT, ADD COLUMN uncle_hash VARCHAR(66) + + +-- +goose Down +ALTER TABLE blocks + Drop COLUMN block_difficulty, + Drop COLUMN block_hash, + drop COLUMN block_nonce, + drop COLUMN block_parenthash, + drop COLUMN block_size, + drop COLUMN uncle_hash \ No newline at end of file diff --git a/db/migrations/1510257608_add_contracts_table.up.sql b/db/migrations/20171109210008_add_contracts_table.sql similarity index 61% rename from db/migrations/1510257608_add_contracts_table.up.sql rename to db/migrations/20171109210008_add_contracts_table.sql index c6dfe39a..71d263f5 100644 --- a/db/migrations/1510257608_add_contracts_table.up.sql +++ b/db/migrations/20171109210008_add_contracts_table.sql @@ -1,5 +1,9 @@ +-- +goose Up CREATE TABLE watched_contracts ( contract_id SERIAL PRIMARY KEY, contract_hash VARCHAR(66) -) \ No newline at end of file +) + +-- +goose Down +DROP TABLE watched_contracts \ No newline at end of file diff --git a/db/migrations/20171109222835_add_from_to_transactions.sql b/db/migrations/20171109222835_add_from_to_transactions.sql new file mode 100644 index 00000000..26c765e2 --- /dev/null +++ b/db/migrations/20171109222835_add_from_to_transactions.sql @@ -0,0 +1,8 @@ +-- +goose Up +ALTER TABLE transactions + ADD COLUMN tx_from VARCHAR(66) + + +-- +goose Down +ALTER TABLE transactions + DROP COLUMN tx_from diff --git a/db/migrations/20171204205233_add_abi_to_watched_contracts.sql b/db/migrations/20171204205233_add_abi_to_watched_contracts.sql new file mode 100644 index 00000000..5146a059 --- /dev/null +++ b/db/migrations/20171204205233_add_abi_to_watched_contracts.sql @@ -0,0 +1,7 @@ +-- +goose Up +ALTER TABLE watched_contracts + ADD COLUMN contract_abi json; + +-- +goose Down +ALTER TABLE watched_contracts + DROP COLUMN contract_abi; \ No newline at end of file diff --git a/db/migrations/1512504078_add_nodes_table.up.sql b/db/migrations/20171205210118_add_nodes_table.sql similarity index 76% rename from db/migrations/1512504078_add_nodes_table.up.sql rename to db/migrations/20171205210118_add_nodes_table.sql index 06fa91d9..86da63e5 100644 --- a/db/migrations/1512504078_add_nodes_table.up.sql +++ b/db/migrations/20171205210118_add_nodes_table.sql @@ -1,6 +1,10 @@ +-- +goose Up CREATE TABLE nodes ( id SERIAL PRIMARY KEY, genesis_block VARCHAR(66), network_id NUMERIC, CONSTRAINT node_uc UNIQUE (genesis_block, network_id) -); \ No newline at end of file +); + +-- +goose Down +DROP TABLE nodes; \ No newline at end of file diff --git a/db/migrations/1513275969_add_cascade_delete_to_blocks.down.sql b/db/migrations/20171205215440_add_node_fk_to_blocks.sql similarity index 55% rename from db/migrations/1513275969_add_cascade_delete_to_blocks.down.sql rename to db/migrations/20171205215440_add_node_fk_to_blocks.sql index da798ece..9af8bb37 100644 --- a/db/migrations/1513275969_add_cascade_delete_to_blocks.down.sql +++ b/db/migrations/20171205215440_add_node_fk_to_blocks.sql @@ -1,11 +1,10 @@ -BEGIN; - -ALTER TABLE blocks - DROP CONSTRAINT node_fk; - +-- +goose Up ALTER TABLE blocks + ADD COLUMN node_id INTEGER NOT NULL, ADD CONSTRAINT node_fk FOREIGN KEY (node_id) REFERENCES nodes (id); -COMMIT; \ No newline at end of file +-- +goose Down +ALTER TABLE blocks + DROP COLUMN node_id; \ No newline at end of file diff --git a/db/migrations/20171206221647_add_contract_hash_constraint_to_watched_contracts.sql b/db/migrations/20171206221647_add_contract_hash_constraint_to_watched_contracts.sql new file mode 100644 index 00000000..d3ff3158 --- /dev/null +++ b/db/migrations/20171206221647_add_contract_hash_constraint_to_watched_contracts.sql @@ -0,0 +1,8 @@ +-- +goose Up +ALTER TABLE watched_contracts + ADD CONSTRAINT contract_hash_uc UNIQUE (contract_hash); + + +-- +goose Down +ALTER TABLE watched_contracts + DROP CONSTRAINT contract_hash_uc; \ No newline at end of file diff --git a/db/migrations/1513029953_add_logs_table.up.sql b/db/migrations/20171211230553_add_logs_table.sql similarity index 88% rename from db/migrations/1513029953_add_logs_table.up.sql rename to db/migrations/20171211230553_add_logs_table.sql index a0cd805d..c269fc07 100644 --- a/db/migrations/1513029953_add_logs_table.up.sql +++ b/db/migrations/20171211230553_add_logs_table.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE logs ( id SERIAL PRIMARY KEY, block_number BIGINT, @@ -12,3 +13,7 @@ CREATE TABLE logs ( CONSTRAINT log_uc UNIQUE (block_number, index) ); + + +-- +goose Down +DROP TABLE logs; \ No newline at end of file diff --git a/db/migrations/20171213201926_add_cascade_delete_to_transactions.sql b/db/migrations/20171213201926_add_cascade_delete_to_transactions.sql new file mode 100644 index 00000000..7d833d19 --- /dev/null +++ b/db/migrations/20171213201926_add_cascade_delete_to_transactions.sql @@ -0,0 +1,27 @@ +-- +goose Up +BEGIN; + +ALTER TABLE transactions + DROP CONSTRAINT fk_test; + +ALTER TABLE transactions + ADD CONSTRAINT blocks_fk +FOREIGN KEY (block_id) +REFERENCES blocks (id) +ON DELETE CASCADE; + +COMMIT; + + +-- +goose Down +BEGIN; + +ALTER TABLE transactions + DROP CONSTRAINT blocks_fk; + +ALTER TABLE transactions + ADD CONSTRAINT fk_test +FOREIGN KEY (block_id) +REFERENCES blocks (id); + +COMMIT; \ No newline at end of file diff --git a/db/migrations/20171214192609_add_cascade_delete_to_blocks.sql b/db/migrations/20171214192609_add_cascade_delete_to_blocks.sql new file mode 100644 index 00000000..1b4a2939 --- /dev/null +++ b/db/migrations/20171214192609_add_cascade_delete_to_blocks.sql @@ -0,0 +1,26 @@ +-- +goose Up +BEGIN; + +ALTER TABLE blocks + DROP CONSTRAINT node_fk; + +ALTER TABLE blocks + ADD CONSTRAINT node_fk +FOREIGN KEY (node_id) +REFERENCES nodes (id) +ON DELETE CASCADE; + +COMMIT; + +-- +goose Down +BEGIN; + +ALTER TABLE blocks + DROP CONSTRAINT node_fk; + +ALTER TABLE blocks + ADD CONSTRAINT node_fk +FOREIGN KEY (node_id) +REFERENCES nodes (id); + +COMMIT; \ No newline at end of file diff --git a/db/migrations/20171218170356_add_is_final_to_blocks.sql b/db/migrations/20171218170356_add_is_final_to_blocks.sql new file mode 100644 index 00000000..21f5b7ad --- /dev/null +++ b/db/migrations/20171218170356_add_is_final_to_blocks.sql @@ -0,0 +1,7 @@ +-- +goose Up +ALTER TABLE blocks + ADD COLUMN is_final BOOLEAN; + +-- +goose Down +ALTER TABLE blocks + DROP COLUMN is_final; \ No newline at end of file diff --git a/db/migrations/20171220154505_add_unique_constraint_blocks_node.sql b/db/migrations/20171220154505_add_unique_constraint_blocks_node.sql new file mode 100644 index 00000000..6fd23743 --- /dev/null +++ b/db/migrations/20171220154505_add_unique_constraint_blocks_node.sql @@ -0,0 +1,7 @@ +-- +goose Up +ALTER TABLE blocks + ADD CONSTRAINT node_id_block_number_uc UNIQUE (block_number, node_id); + +-- +goose Down +ALTER TABLE blocks + DROP CONSTRAINT node_id_block_number_uc; \ No newline at end of file diff --git a/db/migrations/20171220162655_add_block_id_index_on_transactions_table.sql b/db/migrations/20171220162655_add_block_id_index_on_transactions_table.sql new file mode 100644 index 00000000..feaa1882 --- /dev/null +++ b/db/migrations/20171220162655_add_block_id_index_on_transactions_table.sql @@ -0,0 +1,5 @@ +-- +goose Up +CREATE INDEX block_id_index ON transactions (block_id); + +-- +goose Down +DROP INDEX block_id_index; \ No newline at end of file diff --git a/db/migrations/20171220163224_add_node_id_index_on_blocks_table.sql b/db/migrations/20171220163224_add_node_id_index_on_blocks_table.sql new file mode 100644 index 00000000..915ef645 --- /dev/null +++ b/db/migrations/20171220163224_add_node_id_index_on_blocks_table.sql @@ -0,0 +1,5 @@ +-- +goose Up +CREATE INDEX node_id_index ON blocks (node_id); + +-- +goose Down +DROP INDEX node_id_index; \ No newline at end of file diff --git a/db/migrations/20171220222456_tx_to_index.sql b/db/migrations/20171220222456_tx_to_index.sql new file mode 100644 index 00000000..78139346 --- /dev/null +++ b/db/migrations/20171220222456_tx_to_index.sql @@ -0,0 +1,5 @@ +-- +goose Up +CREATE INDEX tx_to_index ON transactions(tx_to); + +-- +goose Down +DROP INDEX tx_to_index; \ No newline at end of file diff --git a/db/migrations/20171220222500_tx_from_index.sql b/db/migrations/20171220222500_tx_from_index.sql new file mode 100644 index 00000000..a4a9b76c --- /dev/null +++ b/db/migrations/20171220222500_tx_from_index.sql @@ -0,0 +1,5 @@ +-- +goose Up +CREATE INDEX tx_from_index ON transactions(tx_from); + +-- +goose Down +DROP INDEX tx_from_index; \ No newline at end of file diff --git a/db/migrations/20171227173404_add_miner.sql b/db/migrations/20171227173404_add_miner.sql new file mode 100644 index 00000000..f55ae6e6 --- /dev/null +++ b/db/migrations/20171227173404_add_miner.sql @@ -0,0 +1,7 @@ +-- +goose Up +ALTER TABLE blocks + ADD COLUMN block_miner VARCHAR(42); + +-- +goose Down +ALTER TABLE blocks + DROP COLUMN block_miner; \ No newline at end of file diff --git a/db/migrations/20171227185710_add_extra_data.sql b/db/migrations/20171227185710_add_extra_data.sql new file mode 100644 index 00000000..7aabca52 --- /dev/null +++ b/db/migrations/20171227185710_add_extra_data.sql @@ -0,0 +1,7 @@ +-- +goose Up +ALTER TABLE blocks + ADD COLUMN block_extra_data VARCHAR; + +-- +goose Down +ALTER TABLE blocks + DROP COLUMN block_extra_data; \ No newline at end of file diff --git a/db/migrations/20171228164704_add_block_reward_uncle_reward.sql b/db/migrations/20171228164704_add_block_reward_uncle_reward.sql new file mode 100644 index 00000000..9932392f --- /dev/null +++ b/db/migrations/20171228164704_add_block_reward_uncle_reward.sql @@ -0,0 +1,10 @@ +-- +goose Up +ALTER TABLE blocks + ADD COLUMN block_reward NUMERIC, + ADD COLUMN block_uncles_reward NUMERIC; + + +-- +goose Down +ALTER TABLE blocks + DROP COLUMN block_reward, + DROP COLUMN block_uncles_reward; diff --git a/db/migrations/20171229000441_add_data_input_to_transactions.sql b/db/migrations/20171229000441_add_data_input_to_transactions.sql new file mode 100644 index 00000000..549cec6c --- /dev/null +++ b/db/migrations/20171229000441_add_data_input_to_transactions.sql @@ -0,0 +1,7 @@ +-- +goose Up +ALTER TABLE transactions + ADD COLUMN tx_input_data VARCHAR; + +-- +goose Down +ALTER TABLE transactions + DROP COLUMN tx_input_data; \ No newline at end of file diff --git a/db/migrations/1514564898_create_receipts_table.up.sql b/db/migrations/20171229172818_create_receipts_table.sql similarity index 88% rename from db/migrations/1514564898_create_receipts_table.up.sql rename to db/migrations/20171229172818_create_receipts_table.sql index 2c4fd2f8..686a6d9b 100644 --- a/db/migrations/1514564898_create_receipts_table.up.sql +++ b/db/migrations/20171229172818_create_receipts_table.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE receipts ( id SERIAL PRIMARY KEY, @@ -14,3 +15,8 @@ CREATE TABLE receipts ); + + +-- +goose Down +DROP TABLE receipts; + diff --git a/db/migrations/20180102233005_add_transaction_id_index_to_receipts.sql b/db/migrations/20180102233005_add_transaction_id_index_to_receipts.sql new file mode 100644 index 00000000..8f096532 --- /dev/null +++ b/db/migrations/20180102233005_add_transaction_id_index_to_receipts.sql @@ -0,0 +1,5 @@ +-- +goose Up +CREATE INDEX transaction_id_index ON receipts (transaction_id); + +-- +goose Down +DROP INDEX transaction_id_index; diff --git a/db/migrations/20180110203941_add_fields_to_node.sql b/db/migrations/20180110203941_add_fields_to_node.sql new file mode 100644 index 00000000..f5383880 --- /dev/null +++ b/db/migrations/20180110203941_add_fields_to_node.sql @@ -0,0 +1,9 @@ +-- +goose Up +ALTER TABLE nodes + ADD COLUMN node_id VARCHAR(128), + ADD COLUMN client_name VARCHAR; + +-- +goose Down +ALTER TABLE nodes + DROP COLUMN node_id, + DROP COLUMN client_name; \ No newline at end of file diff --git a/db/migrations/20180110204835_update_node_index.sql b/db/migrations/20180110204835_update_node_index.sql new file mode 100644 index 00000000..c783b04f --- /dev/null +++ b/db/migrations/20180110204835_update_node_index.sql @@ -0,0 +1,22 @@ +-- +goose Up +BEGIN; + +ALTER TABLE nodes + DROP CONSTRAINT node_uc; + +ALTER TABLE nodes + ADD CONSTRAINT node_uc UNIQUE (genesis_block, network_id, node_id); + +COMMIT; + +-- +goose Down +-- +goose Up +BEGIN; + +ALTER TABLE nodes + DROP CONSTRAINT node_uc; + +ALTER TABLE nodes + ADD CONSTRAINT node_uc UNIQUE (genesis_block, network_id); + +COMMIT; diff --git a/db/migrations/1516050071_add_log_fk_constraint.up.sql b/db/migrations/20180115220111_add_log_fk_constraint.sql similarity index 51% rename from db/migrations/1516050071_add_log_fk_constraint.up.sql rename to db/migrations/20180115220111_add_log_fk_constraint.sql index 60733b71..22cae14e 100644 --- a/db/migrations/1516050071_add_log_fk_constraint.up.sql +++ b/db/migrations/20180115220111_add_log_fk_constraint.sql @@ -1,3 +1,4 @@ +-- +goose Up BEGIN; ALTER TABLE logs DROP CONSTRAINT log_uc; @@ -11,4 +12,18 @@ FOREIGN KEY (receipt_id) REFERENCES receipts (id) ON DELETE CASCADE; +COMMIT; + +-- +goose Down +BEGIN; + +ALTER TABLE logs + DROP CONSTRAINT receipts_fk; + +ALTER TABLE logs + DROP COLUMN receipt_id; + +ALTER TABLE logs + ADD CONSTRAINT log_uc UNIQUE (block_number, index); + COMMIT; \ No newline at end of file diff --git a/db/migrations/1516648743_add_log_filters.up.sql b/db/migrations/20180122201903_add_log_filters.sql similarity index 86% rename from db/migrations/1516648743_add_log_filters.up.sql rename to db/migrations/20180122201903_add_log_filters.sql index 100a5718..371d3d70 100644 --- a/db/migrations/1516648743_add_log_filters.up.sql +++ b/db/migrations/20180122201903_add_log_filters.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE log_filters ( id SERIAL, name VARCHAR NOT NULL CHECK (name <> ''), @@ -9,4 +10,7 @@ CREATE TABLE log_filters ( topic2 VARCHAR(66), topic3 VARCHAR(66), CONSTRAINT name_uc UNIQUE (name) -); \ No newline at end of file +); + +-- +goose Down +DROP TABLE log_filters; \ No newline at end of file diff --git a/db/migrations/1516653373_add_watched_event_logs.up.sql b/db/migrations/20180122213613_add_watched_event_logs.sql similarity index 90% rename from db/migrations/1516653373_add_watched_event_logs.up.sql rename to db/migrations/20180122213613_add_watched_event_logs.sql index 3bba916f..ae17ee08 100644 --- a/db/migrations/1516653373_add_watched_event_logs.up.sql +++ b/db/migrations/20180122213613_add_watched_event_logs.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE VIEW block_stats AS SELECT max(block_number) AS max_block, @@ -26,4 +27,8 @@ CREATE VIEW watched_event_logs AS WHERE (log_filters.topic0 = logs.topic0 OR log_filters.topic0 ISNULL) AND (log_filters.topic1 = logs.topic1 OR log_filters.topic1 ISNULL) AND (log_filters.topic2 = logs.topic2 OR log_filters.topic2 ISNULL) - AND (log_filters.topic3 = logs.topic3 OR log_filters.topic3 ISNULL); \ No newline at end of file + AND (log_filters.topic3 = logs.topic3 OR log_filters.topic3 ISNULL); + +-- +goose Down +DROP VIEW watched_event_logs; +DROP VIEW block_stats; diff --git a/db/migrations/20180202032433_update_gas_limit_gas_used.sql b/db/migrations/20180202032433_update_gas_limit_gas_used.sql new file mode 100644 index 00000000..798977fe --- /dev/null +++ b/db/migrations/20180202032433_update_gas_limit_gas_used.sql @@ -0,0 +1,39 @@ +-- +goose Up +BEGIN; +ALTER TABLE blocks + ALTER COLUMN block_gaslimit TYPE BIGINT USING block_gaslimit :: BIGINT; + +ALTER TABLE blocks + ALTER COLUMN block_gasused TYPE BIGINT USING block_gasused :: BIGINT; + +ALTER TABLE blocks + ALTER COLUMN block_time TYPE BIGINT USING block_time :: BIGINT; + +ALTER TABLE blocks + ALTER COLUMN block_reward TYPE DOUBLE PRECISION USING block_time :: DOUBLE PRECISION; + +ALTER TABLE blocks + ALTER COLUMN block_uncles_reward TYPE DOUBLE PRECISION USING block_time :: DOUBLE PRECISION; + +COMMIT; + + +-- +goose Down +-- +goose Up +BEGIN; +ALTER TABLE blocks + ALTER COLUMN block_gaslimit TYPE DOUBLE PRECISION USING block_gaslimit :: DOUBLE PRECISION; + +ALTER TABLE blocks + ALTER COLUMN block_gasused TYPE DOUBLE PRECISION USING block_gasused :: DOUBLE PRECISION; + +ALTER TABLE blocks + ALTER COLUMN block_time TYPE DOUBLE PRECISION USING block_time :: DOUBLE PRECISION; + +ALTER TABLE blocks + ALTER COLUMN block_reward TYPE NUMERIC USING block_time :: NUMERIC; + +ALTER TABLE blocks + ALTER COLUMN block_uncles_reward TYPE NUMERIC USING block_time :: NUMERIC; + +COMMIT; \ No newline at end of file diff --git a/db/migrations/20180202213423_rename_block_columns.sql b/db/migrations/20180202213423_rename_block_columns.sql new file mode 100644 index 00000000..e0645838 --- /dev/null +++ b/db/migrations/20180202213423_rename_block_columns.sql @@ -0,0 +1,94 @@ +-- +goose Up +BEGIN; +ALTER TABLE blocks + RENAME COLUMN block_number TO number; + +ALTER TABLE blocks + RENAME COLUMN block_gaslimit TO gaslimit; + +ALTER TABLE blocks + RENAME COLUMN block_gasused TO gasused; + +ALTER TABLE blocks + RENAME COLUMN block_time TO time; + +ALTER TABLE blocks + RENAME COLUMN block_difficulty TO difficulty; + +ALTER TABLE blocks + RENAME COLUMN block_hash TO hash; + +ALTER TABLE blocks + RENAME COLUMN block_nonce TO nonce; + +ALTER TABLE blocks + RENAME COLUMN block_parenthash TO parenthash; + +ALTER TABLE blocks + RENAME COLUMN block_size TO size; + +ALTER TABLE blocks + RENAME COLUMN block_miner TO miner; + +ALTER TABLE blocks + RENAME COLUMN block_extra_data TO extra_data; + +ALTER TABLE blocks + RENAME COLUMN block_reward TO reward; + +ALTER TABLE blocks + RENAME COLUMN block_uncles_reward TO uncles_reward; +COMMIT; + + + + + + + + + + + + +-- +goose Down +BEGIN; +ALTER TABLE blocks + RENAME COLUMN number TO block_number; + +ALTER TABLE blocks + RENAME COLUMN gaslimit TO block_gaslimit; + +ALTER TABLE blocks + RENAME COLUMN gasused TO block_gasused; + +ALTER TABLE blocks + RENAME COLUMN TIME TO block_time; + +ALTER TABLE blocks + RENAME COLUMN difficulty TO block_difficulty; + +ALTER TABLE blocks + RENAME COLUMN HASH TO block_hash; + +ALTER TABLE blocks + RENAME COLUMN nonce TO block_nonce; + +ALTER TABLE blocks + RENAME COLUMN parenthash TO block_parenthash; + +ALTER TABLE blocks + RENAME COLUMN size TO block_size; + +ALTER TABLE blocks + RENAME COLUMN miner TO block_miner; + +ALTER TABLE blocks + RENAME COLUMN extra_data TO block_extra_data; + +ALTER TABLE blocks + RENAME COLUMN reward TO block_reward; + +ALTER TABLE blocks + RENAME COLUMN uncles_reward TO block_uncles_reward; +COMMIT; \ No newline at end of file diff --git a/db/migrations/20180202220756_update_tx_table_names.sql b/db/migrations/20180202220756_update_tx_table_names.sql new file mode 100644 index 00000000..8c463907 --- /dev/null +++ b/db/migrations/20180202220756_update_tx_table_names.sql @@ -0,0 +1,43 @@ +-- +goose Up +BEGIN; +ALTER TABLE transactions + RENAME COLUMN tx_hash TO hash; + +ALTER TABLE transactions + RENAME COLUMN tx_nonce TO nonce; + +ALTER TABLE transactions + RENAME COLUMN tx_gaslimit TO gaslimit; + +ALTER TABLE transactions + RENAME COLUMN tx_gasprice TO gasprice; + +ALTER TABLE transactions + RENAME COLUMN tx_value TO value; + +ALTER TABLE transactions + RENAME COLUMN tx_input_data TO input_data; +COMMIT; + + +-- +goose Down +-- +goose Up +BEGIN; +ALTER TABLE transactions + RENAME COLUMN hash TO tx_hash; + +ALTER TABLE transactions + RENAME COLUMN nonce TO tx_nonce; + +ALTER TABLE transactions + RENAME COLUMN gaslimit TO tx_gaslimit; + +ALTER TABLE transactions + RENAME COLUMN gasprice TO tx_gasprice; + +ALTER TABLE transactions + RENAME COLUMN value TO tx_value; + +ALTER TABLE transactions + RENAME COLUMN input_data TO tx_input_data; +COMMIT; diff --git a/db/migrations/20180205191315_update_log_filters_to_block_constraint.sql b/db/migrations/20180205191315_update_log_filters_to_block_constraint.sql new file mode 100644 index 00000000..025d681e --- /dev/null +++ b/db/migrations/20180205191315_update_log_filters_to_block_constraint.sql @@ -0,0 +1,19 @@ +-- +goose Up +BEGIN; +ALTER TABLE log_filters + DROP CONSTRAINT log_filters_from_block_check1; + +ALTER TABLE log_filters + ADD CONSTRAINT log_filters_to_block_check CHECK (to_block >= 0); +COMMIT; + + +-- +goose Down +-- +goose Up +BEGIN; +ALTER TABLE log_filters + DROP CONSTRAINT log_filters_to_block_check; + +ALTER TABLE log_filters + ADD CONSTRAINT log_filters_from_block_check1 CHECK (to_block >= 0); +COMMIT; \ No newline at end of file diff --git a/db/migrations/20180305233813_update_eth18_types.sql b/db/migrations/20180305233813_update_eth18_types.sql new file mode 100644 index 00000000..b81f5980 --- /dev/null +++ b/db/migrations/20180305233813_update_eth18_types.sql @@ -0,0 +1,9 @@ +-- +goose Up +ALTER TABLE blocks + ALTER COLUMN size TYPE VARCHAR USING size::VARCHAR; + + +-- +goose Down +-- +goose Up +ALTER TABLE blocks + ALTER COLUMN size TYPE BIGINT USING size::BIGINT; diff --git a/db/migrations/20180321150314_rename_node_table.sql b/db/migrations/20180321150314_rename_node_table.sql new file mode 100644 index 00000000..4e4c216f --- /dev/null +++ b/db/migrations/20180321150314_rename_node_table.sql @@ -0,0 +1,47 @@ +-- +goose Up +BEGIN; +ALTER TABLE public.nodes RENAME TO eth_nodes; + +ALTER TABLE public.eth_nodes RENAME COLUMN node_id TO eth_node_id; + +ALTER TABLE public.eth_nodes DROP CONSTRAINT node_uc; +ALTER TABLE public.eth_nodes + ADD CONSTRAINT eth_node_uc UNIQUE (genesis_block, network_id, eth_node_id); + +ALTER TABLE public.blocks RENAME COLUMN node_id TO eth_node_id; + +ALTER TABLE public.blocks DROP CONSTRAINT node_id_block_number_uc; +ALTER TABLE public.blocks + ADD CONSTRAINT eth_node_id_block_number_uc UNIQUE (number, eth_node_id); + +ALTER TABLE public.blocks DROP CONSTRAINT node_fk; +ALTER TABLE public.blocks + ADD CONSTRAINT node_fk +FOREIGN KEY (eth_node_id) REFERENCES eth_nodes (id) ON DELETE CASCADE; + +COMMIT; + +-- +goose Down +BEGIN; +ALTER TABLE public.eth_nodes + RENAME TO nodes; + +ALTER TABLE public.nodes + RENAME COLUMN eth_node_id TO node_id; + +ALTER TABLE public.nodes + DROP CONSTRAINT eth_node_uc; +ALTER TABLE public.nodes + ADD CONSTRAINT node_uc UNIQUE (genesis_block, network_id, node_id); + +ALTER TABLE public.blocks RENAME COLUMN eth_node_id TO node_id; + +ALTER TABLE public.blocks DROP CONSTRAINT eth_node_id_block_number_uc; +ALTER TABLE public.blocks + ADD CONSTRAINT node_id_block_number_uc UNIQUE (number, node_id); + +ALTER TABLE public.blocks DROP CONSTRAINT node_fk; +ALTER TABLE public.blocks + ADD CONSTRAINT node_fk +FOREIGN KEY (node_id) REFERENCES nodes (id) ON DELETE CASCADE; +COMMIT; \ No newline at end of file diff --git a/db/migrations/20180430230941_associate_receipts_with_blocks.sql b/db/migrations/20180430230941_associate_receipts_with_blocks.sql new file mode 100644 index 00000000..1393af19 --- /dev/null +++ b/db/migrations/20180430230941_associate_receipts_with_blocks.sql @@ -0,0 +1,50 @@ +-- +goose Up +BEGIN; + +ALTER TABLE receipts + ADD COLUMN block_id INT; + +UPDATE receipts + SET block_id = ( + SELECT block_id FROM transactions WHERE transactions.id = receipts.transaction_id + ); + +ALTER TABLE receipts + ALTER COLUMN block_id SET NOT NULL; + +ALTER TABLE receipts + ADD CONSTRAINT blocks_fk +FOREIGN KEY (block_id) +REFERENCES blocks (id) +ON DELETE CASCADE; + +ALTER TABLE receipts + DROP COLUMN transaction_id; + +COMMIT; + + +-- +goose Down +BEGIN; + +ALTER TABLE receipts + ADD COLUMN transaction_id INT; + +UPDATE receipts + SET transaction_id = ( + SELECT id FROM transactions WHERE transactions.hash = receipts.tx_hash + ); + +ALTER TABLE receipts + ALTER COLUMN transaction_id SET NOT NULL; + +ALTER TABLE receipts + ADD CONSTRAINT transaction_fk +FOREIGN KEY (transaction_id) +REFERENCES transactions (id) +ON DELETE CASCADE; + +ALTER TABLE receipts + DROP COLUMN block_id; + +COMMIT; \ No newline at end of file diff --git a/db/migrations/1525464568_add_eth_node_fingerprint_to_blocks.up.sql b/db/migrations/20180504220928_add_eth_node_fingerprint_to_blocks.sql similarity index 75% rename from db/migrations/1525464568_add_eth_node_fingerprint_to_blocks.up.sql rename to db/migrations/20180504220928_add_eth_node_fingerprint_to_blocks.sql index 947db2c7..382fec3c 100644 --- a/db/migrations/1525464568_add_eth_node_fingerprint_to_blocks.up.sql +++ b/db/migrations/20180504220928_add_eth_node_fingerprint_to_blocks.sql @@ -1,3 +1,4 @@ +-- +goose Up BEGIN; ALTER TABLE blocks @@ -11,4 +12,8 @@ UPDATE blocks ALTER TABLE blocks ALTER COLUMN eth_node_fingerprint SET NOT NULL; -COMMIT; \ No newline at end of file +COMMIT; + +-- +goose Down +ALTER TABLE blocks + DROP COLUMN eth_node_fingerprint; \ No newline at end of file diff --git a/db/migrations/1528317902_create_token_supply_table.up.sql b/db/migrations/20180606224502_create_token_supply_table.sql similarity index 79% rename from db/migrations/1528317902_create_token_supply_table.up.sql rename to db/migrations/20180606224502_create_token_supply_table.sql index 69289885..f60bd064 100644 --- a/db/migrations/1528317902_create_token_supply_table.up.sql +++ b/db/migrations/20180606224502_create_token_supply_table.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE token_supply ( id SERIAL, block_id INTEGER NOT NULL, @@ -7,3 +8,8 @@ CREATE TABLE token_supply ( REFERENCES blocks (id) ON DELETE CASCADE ) + + +-- +goose Down +-- +goose Up +DROP TABLE token_supply; \ No newline at end of file diff --git a/db/migrations/1531758090_create_headers_table.up.sql b/db/migrations/20180716182130_create_headers_table.sql similarity index 86% rename from db/migrations/1531758090_create_headers_table.up.sql rename to db/migrations/20180716182130_create_headers_table.sql index 47fafda2..128e4380 100644 --- a/db/migrations/1531758090_create_headers_table.up.sql +++ b/db/migrations/20180716182130_create_headers_table.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE public.headers ( id SERIAL PRIMARY KEY, hash VARCHAR(66), @@ -9,4 +10,7 @@ CREATE TABLE public.headers ( CONSTRAINT eth_nodes_fk FOREIGN KEY (eth_node_id) REFERENCES eth_nodes (id) ON DELETE CASCADE -); \ No newline at end of file +); + +-- +goose Down +DROP TABLE public.headers; \ No newline at end of file diff --git a/db/migrations/1532468317_create_checked_headers_table.up.sql b/db/migrations/20180724233837_create_checked_headers_table.sql similarity index 77% rename from db/migrations/1532468317_create_checked_headers_table.up.sql rename to db/migrations/20180724233837_create_checked_headers_table.sql index 6a39e0dd..23cf6d88 100644 --- a/db/migrations/1532468317_create_checked_headers_table.up.sql +++ b/db/migrations/20180724233837_create_checked_headers_table.sql @@ -1,5 +1,9 @@ +-- +goose Up CREATE TABLE public.checked_headers ( id SERIAL PRIMARY KEY, header_id INTEGER UNIQUE NOT NULL REFERENCES headers (id) ON DELETE CASCADE, price_feeds_checked BOOLEAN NOT NULL DEFAULT FALSE -); \ No newline at end of file +); + +-- +goose Down +DROP TABLE public.checked_headers; \ No newline at end of file diff --git a/db/migrations/20180724233838_create_maker_schema.sql b/db/migrations/20180724233838_create_maker_schema.sql new file mode 100644 index 00000000..b74e05ff --- /dev/null +++ b/db/migrations/20180724233838_create_maker_schema.sql @@ -0,0 +1,7 @@ +-- +goose Up +CREATE SCHEMA maker; + + + +-- +goose Down +DROP SCHEMA maker; diff --git a/db/migrations/1532468319_create_flip_kick.up.sql b/db/migrations/20180724233839_create_flip_kick.sql similarity index 72% rename from db/migrations/1532468319_create_flip_kick.up.sql rename to db/migrations/20180724233839_create_flip_kick.sql index 0689bf67..10b8c0f6 100644 --- a/db/migrations/1532468319_create_flip_kick.up.sql +++ b/db/migrations/20180724233839_create_flip_kick.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.flip_kick ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -15,4 +16,10 @@ CREATE TABLE maker.flip_kick ( ); ALTER TABLE public.checked_headers - ADD COLUMN flip_kick_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN flip_kick_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.flip_kick; + +ALTER TABLE public.checked_headers + DROP COLUMN flip_kick_checked; \ No newline at end of file diff --git a/db/migrations/1533844125_create_frob.up.sql b/db/migrations/20180809214845_create_frob.sql similarity index 71% rename from db/migrations/1533844125_create_frob.up.sql rename to db/migrations/20180809214845_create_frob.sql index 2ef436b1..8c13f913 100644 --- a/db/migrations/1533844125_create_frob.up.sql +++ b/db/migrations/20180809214845_create_frob.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.frob ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -15,4 +16,10 @@ CREATE TABLE maker.frob ( ); ALTER TABLE public.checked_headers - ADD COLUMN frob_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN frob_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.frob; + +ALTER TABLE public.checked_headers + DROP COLUMN frob_checked; \ No newline at end of file diff --git a/db/migrations/1534275305_create_price_feeds_table.up.sql b/db/migrations/20180814213505_create_price_feeds_table.sql similarity index 87% rename from db/migrations/1534275305_create_price_feeds_table.up.sql rename to db/migrations/20180814213505_create_price_feeds_table.sql index 9ea8c12a..cb325048 100644 --- a/db/migrations/1534275305_create_price_feeds_table.up.sql +++ b/db/migrations/20180814213505_create_price_feeds_table.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.price_feeds ( id SERIAL PRIMARY KEY, block_number BIGINT NOT NULL, @@ -8,4 +9,7 @@ CREATE TABLE maker.price_feeds ( tx_idx INTEGER NOT NULL, raw_log JSONB, UNIQUE (header_id, medianizer_address, tx_idx, log_idx) -); \ No newline at end of file +); + +-- +goose Down +DROP TABLE maker.price_feeds; \ No newline at end of file diff --git a/db/migrations/1534295712_create_tend.up.sql b/db/migrations/20180815031512_create_tend.sql similarity index 81% rename from db/migrations/1534295712_create_tend.up.sql rename to db/migrations/20180815031512_create_tend.sql index 8c6a162f..e4d07c2c 100644 --- a/db/migrations/1534295712_create_tend.up.sql +++ b/db/migrations/20180815031512_create_tend.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.tend ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -14,3 +15,10 @@ CREATE TABLE maker.tend ( ALTER TABLE public.checked_headers ADD COLUMN tend_checked BOOLEAN NOT NULL DEFAULT FALSE; + + +-- +goose Down +DROP TABLE maker.tend; + +ALTER TABLE public.checked_headers + DROP COLUMN tend_checked; \ No newline at end of file diff --git a/db/migrations/1534295713_create_bite.up.sql b/db/migrations/20180815031513_create_bite.sql similarity index 71% rename from db/migrations/1534295713_create_bite.up.sql rename to db/migrations/20180815031513_create_bite.sql index 4de235e5..adc1dab1 100644 --- a/db/migrations/1534295713_create_bite.up.sql +++ b/db/migrations/20180815031513_create_bite.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.bite ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -15,4 +16,10 @@ CREATE TABLE maker.bite ( ); ALTER TABLE public.checked_headers - ADD COLUMN bite_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN bite_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.bite; + +ALTER TABLE public.checked_headers + DROP COLUMN bite_checked; \ No newline at end of file diff --git a/db/migrations/1534799167_create_dent.up.sql b/db/migrations/20180820230607_create_dent.sql similarity index 81% rename from db/migrations/1534799167_create_dent.up.sql rename to db/migrations/20180820230607_create_dent.sql index 3e408aab..a0179aa4 100644 --- a/db/migrations/1534799167_create_dent.up.sql +++ b/db/migrations/20180820230607_create_dent.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.dent ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -14,3 +15,10 @@ CREATE TABLE maker.dent ( ALTER TABLE public.checked_headers ADD COLUMN dent_checked BOOLEAN NOT NULL DEFAULT FALSE; + + +-- +goose Down +DROP TABLE maker.dent; + +ALTER TABLE public.checked_headers + DROP COLUMN dent_checked; \ No newline at end of file diff --git a/db/migrations/1535667935_create_pit_file.up.sql b/db/migrations/20180831002535_create_pit_file.sql similarity index 76% rename from db/migrations/1535667935_create_pit_file.up.sql rename to db/migrations/20180831002535_create_pit_file.sql index 00d3695e..f7305c4e 100644 --- a/db/migrations/1535667935_create_pit_file.up.sql +++ b/db/migrations/20180831002535_create_pit_file.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.pit_file_ilk ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -39,4 +40,18 @@ ALTER TABLE public.checked_headers ADD COLUMN pit_file_ilk_checked BOOLEAN NOT NULL DEFAULT FALSE; ALTER TABLE public.checked_headers - ADD COLUMN pit_file_stability_fee_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN pit_file_stability_fee_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.pit_file_ilk; +DROP TABLE maker.pit_file_stability_fee; +DROP TABLE maker.pit_file_debt_ceiling; + +ALTER TABLE public.checked_headers + DROP COLUMN pit_file_debt_ceiling_checked; + +ALTER TABLE public.checked_headers + DROP COLUMN pit_file_ilk_checked; + +ALTER TABLE public.checked_headers + DROP COLUMN pit_file_stability_fee_checked; \ No newline at end of file diff --git a/db/migrations/1536267596_create_vat_init.up.sql b/db/migrations/20180906225956_create_vat_init.sql similarity index 64% rename from db/migrations/1536267596_create_vat_init.up.sql rename to db/migrations/20180906225956_create_vat_init.sql index 38c5402d..a3d59e61 100644 --- a/db/migrations/1536267596_create_vat_init.up.sql +++ b/db/migrations/20180906225956_create_vat_init.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.vat_init ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -9,4 +10,10 @@ CREATE TABLE maker.vat_init ( ); ALTER TABLE public.checked_headers - ADD COLUMN vat_init_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN vat_init_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.vat_init; + +ALTER TABLE public.checked_headers + DROP COLUMN vat_init_checked; \ No newline at end of file diff --git a/db/migrations/1536603967_create_drip_file.up.sql b/db/migrations/20180910202607_create_drip_file.sql similarity index 77% rename from db/migrations/1536603967_create_drip_file.up.sql rename to db/migrations/20180910202607_create_drip_file.sql index 0c657f0f..ecf1140d 100644 --- a/db/migrations/1536603967_create_drip_file.up.sql +++ b/db/migrations/20180910202607_create_drip_file.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.drip_file_ilk ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -39,4 +40,18 @@ ALTER TABLE public.checked_headers ADD COLUMN drip_file_repo_checked BOOLEAN NOT NULL DEFAULT FALSE; ALTER TABLE public.checked_headers - ADD COLUMN drip_file_vow_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN drip_file_vow_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.drip_file_ilk; +DROP TABLE maker.drip_file_repo; +DROP TABLE maker.drip_file_vow; + +ALTER TABLE public.checked_headers + DROP COLUMN drip_file_ilk_checked; + +ALTER TABLE public.checked_headers + DROP COLUMN drip_file_repo_checked; + +ALTER TABLE public.checked_headers + DROP COLUMN drip_file_vow_checked; \ No newline at end of file diff --git a/db/migrations/1536615440_create_deal.up.sql b/db/migrations/20180910233720_create_deal.sql similarity index 69% rename from db/migrations/1536615440_create_deal.up.sql rename to db/migrations/20180910233720_create_deal.sql index ce5db6c6..42046693 100644 --- a/db/migrations/1536615440_create_deal.up.sql +++ b/db/migrations/20180910233720_create_deal.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.deal ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -10,4 +11,10 @@ CREATE TABLE maker.deal ( ); ALTER TABLE public.checked_headers - ADD COLUMN deal_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN deal_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.deal; + +ALTER TABLE public.checked_headers + DROP COLUMN deal_checked; \ No newline at end of file diff --git a/db/migrations/1536702963_add_price_feed_trigger.up.sql b/db/migrations/20180911235603_add_price_feed_trigger.sql similarity index 82% rename from db/migrations/1536702963_add_price_feed_trigger.up.sql rename to db/migrations/20180911235603_add_price_feed_trigger.sql index 1127c8e2..a55d0bdf 100644 --- a/db/migrations/1536702963_add_price_feed_trigger.up.sql +++ b/db/migrations/20180911235603_add_price_feed_trigger.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE OR REPLACE FUNCTION notify_pricefeed() RETURNS trigger AS $$ BEGIN PERFORM pg_notify( @@ -12,3 +13,7 @@ CREATE TRIGGER notify_pricefeeds AFTER INSERT ON maker.price_feeds FOR EACH ROW EXECUTE PROCEDURE notify_pricefeed(); + + +-- +goose Down +DROP TRIGGER notify_pricefeeds ON maker.price_feeds; diff --git a/db/migrations/1536710319_create_drip_drip.up.sql b/db/migrations/20180912015839_create_drip_drip.sql similarity index 63% rename from db/migrations/1536710319_create_drip_drip.up.sql rename to db/migrations/20180912015839_create_drip_drip.sql index b9ff8bb4..baefddf0 100644 --- a/db/migrations/1536710319_create_drip_drip.up.sql +++ b/db/migrations/20180912015839_create_drip_drip.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.drip_drip ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -9,4 +10,10 @@ CREATE TABLE maker.drip_drip ( ); ALTER TABLE public.checked_headers - ADD COLUMN drip_drip_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN drip_drip_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.drip_drip; + +ALTER TABLE public.checked_headers + DROP COLUMN drip_drip_checked; \ No newline at end of file diff --git a/db/migrations/1536765047_create_cat_file.up.sql b/db/migrations/20180912171047_create_cat_file.sql similarity index 78% rename from db/migrations/1536765047_create_cat_file.up.sql rename to db/migrations/20180912171047_create_cat_file.sql index 100c14e6..e25df996 100644 --- a/db/migrations/1536765047_create_cat_file.up.sql +++ b/db/migrations/20180912171047_create_cat_file.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.cat_file_chop_lump ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -40,4 +41,18 @@ ALTER TABLE public.checked_headers ADD COLUMN cat_file_flip_checked BOOLEAN NOT NULL DEFAULT FALSE; ALTER TABLE public.checked_headers - ADD COLUMN cat_file_pit_vow_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN cat_file_pit_vow_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.cat_file_chop_lump; +DROP TABLE maker.cat_file_flip; +DROP TABLE maker.cat_file_pit_vow; + +ALTER TABLE public.checked_headers + DROP COLUMN cat_file_chop_lump_checked; + +ALTER TABLE public.checked_headers + DROP COLUMN cat_file_flip_checked; + +ALTER TABLE public.checked_headers + DROP COLUMN cat_file_pit_vow_checked; \ No newline at end of file diff --git a/db/migrations/1536942529_create_flop_kick.up.sql b/db/migrations/20180914182849_create_flop_kick.sql similarity index 71% rename from db/migrations/1536942529_create_flop_kick.up.sql rename to db/migrations/20180914182849_create_flop_kick.sql index da3bc353..a62e3d47 100644 --- a/db/migrations/1536942529_create_flop_kick.up.sql +++ b/db/migrations/20180914182849_create_flop_kick.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.flop_kick ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -13,4 +14,9 @@ CREATE TABLE maker.flop_kick ( ); ALTER TABLE public.checked_headers - ADD COLUMN flop_kick_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN flop_kick_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.flop_kick; +ALTER TABLE public.checked_headers + DROP COLUMN flop_kick_checked; \ No newline at end of file diff --git a/db/migrations/1538396815_create_vat_move.up.sql b/db/migrations/20181001142655_create_vat_move.sql similarity index 79% rename from db/migrations/1538396815_create_vat_move.up.sql rename to db/migrations/20181001142655_create_vat_move.sql index 8c355133..7aa31a24 100644 --- a/db/migrations/1538396815_create_vat_move.up.sql +++ b/db/migrations/20181001142655_create_vat_move.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.vat_move ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -12,3 +13,9 @@ CREATE TABLE maker.vat_move ( ALTER TABLE public.checked_headers ADD COLUMN vat_move_checked BOOLEAN NOT NULL DEFAULT FALSE; + + +-- +goose Down +DROP TABLE maker.vat_move; +ALTER TABLE public.checked_headers + DROP COLUMN vat_move_checked; \ No newline at end of file diff --git a/db/migrations/1538510582_create_vat_fold_table.up.sql b/db/migrations/20181002220302_create_vat_fold_table.sql similarity index 76% rename from db/migrations/1538510582_create_vat_fold_table.up.sql rename to db/migrations/20181002220302_create_vat_fold_table.sql index 4076ec0d..33c54fae 100644 --- a/db/migrations/1538510582_create_vat_fold_table.up.sql +++ b/db/migrations/20181002220302_create_vat_fold_table.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.vat_fold ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -12,3 +13,9 @@ CREATE TABLE maker.vat_fold ( ALTER TABLE public.checked_headers ADD COLUMN vat_fold_checked BOOLEAN NOT NULL DEFAULT FALSE; + + +-- +goose Down +DROP TABLE maker.vat_fold; +ALTER TABLE public.checked_headers + DROP COLUMN vat_fold_checked; diff --git a/db/migrations/1538671228_create_vat_heal.up.sql b/db/migrations/20181004184028_create_vat_heal.sql similarity index 77% rename from db/migrations/1538671228_create_vat_heal.up.sql rename to db/migrations/20181004184028_create_vat_heal.sql index fa1fc5a5..a5524b4f 100644 --- a/db/migrations/1538671228_create_vat_heal.up.sql +++ b/db/migrations/20181004184028_create_vat_heal.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.vat_heal ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -12,3 +13,9 @@ CREATE TABLE maker.vat_heal ( ALTER TABLE public.checked_headers ADD COLUMN vat_heal_checked BOOLEAN NOT NULL DEFAULT FALSE; + + +-- +goose Down +DROP TABLE maker.vat_heal; +ALTER TABLE public.checked_headers + DROP COLUMN vat_heal_checked; diff --git a/db/migrations/1538679495_create_vat_toll.up.sql b/db/migrations/20181004205815_create_vat_toll.sql similarity index 67% rename from db/migrations/1538679495_create_vat_toll.up.sql rename to db/migrations/20181004205815_create_vat_toll.sql index 9b2f3673..1e29fbb1 100644 --- a/db/migrations/1538679495_create_vat_toll.up.sql +++ b/db/migrations/20181004205815_create_vat_toll.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.vat_toll ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -11,4 +12,9 @@ CREATE TABLE maker.vat_toll ( ); ALTER TABLE public.checked_headers - ADD COLUMN vat_toll_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN vat_toll_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.vat_toll; +ALTER TABLE public.checked_headers + DROP COLUMN vat_toll_checked; \ No newline at end of file diff --git a/db/migrations/1538689084_create_vat_tune.up.sql b/db/migrations/20181004233804_create_vat_tune.sql similarity index 70% rename from db/migrations/1538689084_create_vat_tune.up.sql rename to db/migrations/20181004233804_create_vat_tune.sql index 3cabdc73..07f625aa 100644 --- a/db/migrations/1538689084_create_vat_tune.up.sql +++ b/db/migrations/20181004233804_create_vat_tune.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.vat_tune ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -14,4 +15,9 @@ CREATE TABLE maker.vat_tune ( ); ALTER TABLE public.checked_headers - ADD COLUMN vat_tune_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN vat_tune_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.vat_tune; +ALTER TABLE public.checked_headers + DROP COLUMN vat_tune_checked; \ No newline at end of file diff --git a/db/migrations/1539033620_create_vat_grab.up.sql b/db/migrations/20181008232020_create_vat_grab.sql similarity index 70% rename from db/migrations/1539033620_create_vat_grab.up.sql rename to db/migrations/20181008232020_create_vat_grab.sql index 85aa8d50..7fa5035d 100644 --- a/db/migrations/1539033620_create_vat_grab.up.sql +++ b/db/migrations/20181008232020_create_vat_grab.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.vat_grab ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -14,4 +15,9 @@ CREATE TABLE maker.vat_grab ( ); ALTER TABLE public.checked_headers - ADD COLUMN vat_grab_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN vat_grab_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.vat_grab; +ALTER TABLE public.checked_headers + DROP COLUMN vat_grab_checked; \ No newline at end of file diff --git a/db/migrations/1539276289_create_vat_flux_table.up.sql b/db/migrations/20181011184449_create_vat_flux_table.sql similarity index 78% rename from db/migrations/1539276289_create_vat_flux_table.up.sql rename to db/migrations/20181011184449_create_vat_flux_table.sql index ebc3182e..f0e659f2 100644 --- a/db/migrations/1539276289_create_vat_flux_table.up.sql +++ b/db/migrations/20181011184449_create_vat_flux_table.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.vat_flux ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -13,3 +14,9 @@ CREATE TABLE maker.vat_flux ( ALTER TABLE public.checked_headers ADD COLUMN vat_flux_checked BOOLEAN NOT NULL DEFAULT FALSE; + + +-- +goose Down +DROP TABLE maker.vat_flux; +ALTER TABLE public.checked_headers + DROP COLUMN vat_flux_checked; diff --git a/db/migrations/1539638109_create_vat_slip.up.sql b/db/migrations/20181015231509_create_vat_slip.sql similarity index 67% rename from db/migrations/1539638109_create_vat_slip.up.sql rename to db/migrations/20181015231509_create_vat_slip.sql index cf5e270b..a561eb69 100644 --- a/db/migrations/1539638109_create_vat_slip.up.sql +++ b/db/migrations/20181015231509_create_vat_slip.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.vat_slip ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -11,4 +12,9 @@ CREATE TABLE maker.vat_slip ( ); ALTER TABLE public.checked_headers - ADD COLUMN vat_slip_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN vat_slip_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.vat_slip; +ALTER TABLE public.checked_headers + DROP COLUMN vat_slip_checked; \ No newline at end of file diff --git a/db/migrations/1540297136_create_vow_flog.up.sql b/db/migrations/20181023141856_create_vow_flog.sql similarity index 64% rename from db/migrations/1540297136_create_vow_flog.up.sql rename to db/migrations/20181023141856_create_vow_flog.sql index 816de60c..c7e316bc 100644 --- a/db/migrations/1540297136_create_vow_flog.up.sql +++ b/db/migrations/20181023141856_create_vow_flog.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.vow_flog ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -9,4 +10,9 @@ CREATE TABLE maker.vow_flog ( ); ALTER TABLE public.checked_headers - ADD COLUMN vow_flog_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN vow_flog_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.vow_flog; +ALTER TABLE public.checked_headers + DROP COLUMN vow_flog_checked; \ No newline at end of file diff --git a/db/migrations/1541525500_create_flap_kick.up.sql b/db/migrations/20181106183140_create_flap_kick.sql similarity index 71% rename from db/migrations/1541525500_create_flap_kick.up.sql rename to db/migrations/20181106183140_create_flap_kick.sql index aabc8ec3..ab929cfd 100644 --- a/db/migrations/1541525500_create_flap_kick.up.sql +++ b/db/migrations/20181106183140_create_flap_kick.sql @@ -1,3 +1,4 @@ +-- +goose Up CREATE TABLE maker.flap_kick ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, @@ -13,4 +14,9 @@ CREATE TABLE maker.flap_kick ( ); ALTER TABLE public.checked_headers - ADD COLUMN flap_kick_checked BOOLEAN NOT NULL DEFAULT FALSE; \ No newline at end of file + ADD COLUMN flap_kick_checked BOOLEAN NOT NULL DEFAULT FALSE; + +-- +goose Down +DROP TABLE maker.flap_kick; +ALTER TABLE public.checked_headers + DROP COLUMN flap_kick_checked; \ No newline at end of file diff --git a/db/migrations/1542222088_drop_pit_file_stability_fee.down.sql b/db/migrations/20181114200128_drop_pit_file_stability_fee.sql similarity index 72% rename from db/migrations/1542222088_drop_pit_file_stability_fee.down.sql rename to db/migrations/20181114200128_drop_pit_file_stability_fee.sql index e8590699..f5f20d8f 100644 --- a/db/migrations/1542222088_drop_pit_file_stability_fee.down.sql +++ b/db/migrations/20181114200128_drop_pit_file_stability_fee.sql @@ -1,3 +1,11 @@ +-- +goose Up +DROP TABLE maker.pit_file_stability_fee; + +ALTER TABLE public.checked_headers + DROP COLUMN pit_file_stability_fee_checked; + + +-- +goose Down CREATE TABLE maker.pit_file_stability_fee ( id SERIAL PRIMARY KEY, header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,