From 0a96a366d302240a38d0f033abac35979e8e7d0b Mon Sep 17 00:00:00 2001 From: Edvard Date: Tue, 22 Jan 2019 13:15:29 +0100 Subject: [PATCH 01/10] Change migration timestamp from epoch to yyyymmddhhmmss --- .../1508943247_create_blocks_table.down.sql | 1 - .../1508943247_create_blocks_table.up.sql | 4 - .../1508965325_add_columns_to_blocks.down.sql | 5 - ...9119369_initial_transaction_table.down.sql | 1 - ...9391861_add_primary_key_to_blocks.down.sql | 1 - ...509391861_add_primary_key_to_blocks.up.sql | 1 - ...0207_add_block_id_to_transactions.down.sql | 2 - .../1509484288_add_block_index.down.sql | 1 - .../1509484288_add_block_index.up.sql | 1 - .../1509633481_add_blocks_columns.down.sql | 7 -- .../1510257608_add_contracts_table.down.sql | 1 - ...10262915_add_from_to_transactions.down.sql | 2 - ...1510262915_add_from_to_transactions.up.sql | 2 - ...7153_add_abi_to_watched_contracts.down.sql | 2 - ...417153_add_abi_to_watched_contracts.up.sql | 2 - .../1512504078_add_nodes_table.down.sql | 1 - .../1512507280_add_node_fk_to_blocks.down.sql | 2 - .../1512507280_add_node_fk_to_blocks.up.sql | 5 - ...h_constraint_to_watched_contracts.down.sql | 2 - ...ash_constraint_to_watched_contracts.up.sql | 2 - .../1513029953_add_logs_table.down.sql | 1 - ...dd_cascade_delete_to_transactions.down.sql | 11 --- ..._add_cascade_delete_to_transactions.up.sql | 12 --- ...275969_add_cascade_delete_to_blocks.up.sql | 12 --- ...1513613036_add_is_final_to_blocks.down.sql | 2 - .../1513613036_add_is_final_to_blocks.up.sql | 2 - ...add_unique_constraint_blocks_node.down.sql | 2 - ...5_add_unique_constraint_blocks_node.up.sql | 2 - ...ck_id_index_on_transactions_table.down.sql | 1 - ...lock_id_index_on_transactions_table.up.sql | 1 - ...add_node_id_index_on_blocks_table.down.sql | 1 - ...4_add_node_id_index_on_blocks_table.up.sql | 1 - db/migrations/1513805096_tx_to_index.down.sql | 1 - db/migrations/1513805096_tx_to_index.up.sql | 1 - .../1513805100_tx_from_index.down.sql | 1 - db/migrations/1513805100_tx_from_index.up.sql | 1 - db/migrations/1514392444_add_miner.down.sql | 2 - db/migrations/1514392444_add_miner.up.sql | 2 - .../1514397430_add_extra_data.down.sql | 2 - .../1514397430_add_extra_data.up.sql | 2 - ...024_add_block_reward_uncle_reward.down.sql | 3 - ...76024_add_block_reward_uncle_reward.up.sql | 3 - ...81_add_data_input_to_transactions.down.sql | 2 - ...2281_add_data_input_to_transactions.up.sql | 2 - .../1514564898_create_receipts_table.down.sql | 2 - ..._transaction_id_index_to_receipts.down.sql | 1 - ...dd_transaction_id_index_to_receipts.up.sql | 1 - .../1515613181_add_fields_to_node.down.sql | 3 - .../1515613181_add_fields_to_node.up.sql | 3 - .../1515613715_update_node_index.down.sql | 9 -- .../1515613715_update_node_index.up.sql | 9 -- .../1516050071_add_log_fk_constraint.down.sql | 12 --- .../1516648743_add_log_filters.down.sql | 1 - ...1516653373_add_watched_event_logs.down.sql | 2 - ...7538273_update_gas_limit_gas_used.down.sql | 17 ---- ...517538273_update_gas_limit_gas_used.up.sql | 17 ---- .../1517603663_rename_block_columns.down.sql | 40 -------- .../1517603663_rename_block_columns.up.sql | 50 ---------- .../1517605676_update_tx_table_names.down.sql | 19 ---- .../1517605676_update_tx_table_names.up.sql | 19 ---- ...e_log_filters_to_block_constraint.down.sql | 7 -- ...ate_log_filters_to_block_constraint.up.sql | 7 -- .../1520289493_update_eth18_types.down.sql | 2 - .../1520289493_update_eth18_types.up.sql | 2 - .../1521640994_rename_node_table.down.sql | 23 ----- .../1521640994_rename_node_table.up.sql | 21 ----- ...81_associate_receipts_with_blocks.down.sql | 25 ----- ...2581_associate_receipts_with_blocks.up.sql | 23 ----- ...dd_eth_node_fingerprint_to_blocks.down.sql | 2 - ...8317902_create_token_supply_table.down.sql | 1 - .../1531758090_create_headers_table.down.sql | 1 - ...8317_create_checked_headers_table.down.sql | 1 - .../1532468318_create_maker_schema.down.sql | 1 - .../1532468318_create_maker_schema.up.sql | 2 - .../1532468319_create_flip_kick.down.sql | 4 - db/migrations/1533844125_create_frob.down.sql | 4 - ...34275305_create_price_feeds_table.down.sql | 1 - db/migrations/1534295712_create_tend.down.sql | 4 - db/migrations/1534295713_create_bite.down.sql | 4 - db/migrations/1534799167_create_dent.down.sql | 4 - .../1535667935_create_pit_file.down.sql | 12 --- .../1536267596_create_vat_init.down.sql | 4 - .../1536603967_create_drip_file.down.sql | 12 --- db/migrations/1536615440_create_deal.down.sql | 4 - ...1536702963_add_price_feed_trigger.down.sql | 1 - .../1536710319_create_drip_drip.down.sql | 4 - .../1536765047_create_cat_file.down.sql | 12 --- .../1536942529_create_flop_kick.down.sql | 3 - .../1538396815_create_vat_move.down.sql | 3 - .../1538510582_create_vat_fold_table.down.sql | 3 - .../1538671228_create_vat_heal.down.sql | 3 - .../1538679495_create_vat_toll.down.sql | 3 - .../1538689084_create_vat_tune.down.sql | 3 - .../1539033620_create_vat_grab.down.sql | 3 - .../1539276289_create_vat_flux_table.down.sql | 3 - .../1539638109_create_vat_slip.down.sql | 3 - .../1540297136_create_vow_flog.down.sql | 3 - .../1541525500_create_flap_kick.down.sql | 3 - ...2222088_drop_pit_file_stability_fee.up.sql | 4 - .../20171025165407_create_blocks_table.sql | 9 ++ ... 20171025230205_add_columns_to_blocks.sql} | 9 ++ ...71027174929_initial_transaction_table.sql} | 6 +- ...171030203101_add_primary_key_to_blocks.sql | 5 + ...31153007_add_block_id_to_transactions.sql} | 6 ++ .../20171031221128_add_block_index.sql | 6 ++ ... => 20171102153801_add_blocks_columns.sql} | 11 +++ ...=> 20171109210008_add_contracts_table.sql} | 6 +- ...0171109222835_add_from_to_transactions.sql | 8 ++ ...204205233_add_abi_to_watched_contracts.sql | 7 ++ ...sql => 20171205210118_add_nodes_table.sql} | 6 +- ... 20171205215440_add_node_fk_to_blocks.sql} | 11 +-- ...t_hash_constraint_to_watched_contracts.sql | 8 ++ ....sql => 20171211230553_add_logs_table.sql} | 5 + ...926_add_cascade_delete_to_transactions.sql | 27 ++++++ ...214192609_add_cascade_delete_to_blocks.sql | 26 +++++ .../20171218170356_add_is_final_to_blocks.sql | 7 ++ ...4505_add_unique_constraint_blocks_node.sql | 7 ++ ...d_block_id_index_on_transactions_table.sql | 5 + ...3224_add_node_id_index_on_blocks_table.sql | 5 + db/migrations/20171220222456_tx_to_index.sql | 5 + .../20171220222500_tx_from_index.sql | 5 + db/migrations/20171227173404_add_miner.sql | 7 ++ .../20171227185710_add_extra_data.sql | 7 ++ ...28164704_add_block_reward_uncle_reward.sql | 10 ++ ...9000441_add_data_input_to_transactions.sql | 7 ++ ... 20171229172818_create_receipts_table.sql} | 6 ++ ...5_add_transaction_id_index_to_receipts.sql | 5 + .../20180110203941_add_fields_to_node.sql | 9 ++ .../20180110204835_update_node_index.sql | 22 +++++ ... 20180115220111_add_log_fk_constraint.sql} | 15 +++ ...sql => 20180122201903_add_log_filters.sql} | 6 +- ...20180122213613_add_watched_event_logs.sql} | 7 +- ...180202032433_update_gas_limit_gas_used.sql | 39 ++++++++ .../20180202213423_rename_block_columns.sql | 94 +++++++++++++++++++ .../20180202220756_update_tx_table_names.sql | 43 +++++++++ ...update_log_filters_to_block_constraint.sql | 19 ++++ .../20180305233813_update_eth18_types.sql | 9 ++ .../20180321150314_rename_node_table.sql | 47 ++++++++++ ...0230941_associate_receipts_with_blocks.sql | 50 ++++++++++ ...28_add_eth_node_fingerprint_to_blocks.sql} | 7 +- ...80606224502_create_token_supply_table.sql} | 6 ++ ...> 20180716182130_create_headers_table.sql} | 6 +- ...24233837_create_checked_headers_table.sql} | 6 +- .../20180724233838_create_maker_schema.sql | 7 ++ ...ql => 20180724233839_create_flip_kick.sql} | 9 +- ....up.sql => 20180809214845_create_frob.sql} | 9 +- ...180814213505_create_price_feeds_table.sql} | 6 +- ....up.sql => 20180815031512_create_tend.sql} | 8 ++ ....up.sql => 20180815031513_create_bite.sql} | 9 +- ....up.sql => 20180820230607_create_dent.sql} | 8 ++ ...sql => 20180831002535_create_pit_file.sql} | 17 +++- ...sql => 20180906225956_create_vat_init.sql} | 9 +- ...ql => 20180910202607_create_drip_file.sql} | 17 +++- ....up.sql => 20180910233720_create_deal.sql} | 9 +- ...20180911235603_add_price_feed_trigger.sql} | 5 + ...ql => 20180912015839_create_drip_drip.sql} | 9 +- ...sql => 20180912171047_create_cat_file.sql} | 17 +++- ...ql => 20180914182849_create_flop_kick.sql} | 8 +- ...sql => 20181001142655_create_vat_move.sql} | 7 ++ ... 20181002220302_create_vat_fold_table.sql} | 7 ++ ...sql => 20181004184028_create_vat_heal.sql} | 7 ++ ...sql => 20181004205815_create_vat_toll.sql} | 8 +- ...sql => 20181004233804_create_vat_tune.sql} | 8 +- ...sql => 20181008232020_create_vat_grab.sql} | 8 +- ... 20181011184449_create_vat_flux_table.sql} | 7 ++ ...sql => 20181015231509_create_vat_slip.sql} | 8 +- ...sql => 20181023141856_create_vow_flog.sql} | 8 +- ...ql => 20181106183140_create_flap_kick.sql} | 8 +- ...114200128_drop_pit_file_stability_fee.sql} | 8 ++ 169 files changed, 817 insertions(+), 576 deletions(-) delete mode 100644 db/migrations/1508943247_create_blocks_table.down.sql delete mode 100644 db/migrations/1508943247_create_blocks_table.up.sql delete mode 100644 db/migrations/1508965325_add_columns_to_blocks.down.sql delete mode 100644 db/migrations/1509119369_initial_transaction_table.down.sql delete mode 100644 db/migrations/1509391861_add_primary_key_to_blocks.down.sql delete mode 100644 db/migrations/1509391861_add_primary_key_to_blocks.up.sql delete mode 100644 db/migrations/1509460207_add_block_id_to_transactions.down.sql delete mode 100644 db/migrations/1509484288_add_block_index.down.sql delete mode 100644 db/migrations/1509484288_add_block_index.up.sql delete mode 100644 db/migrations/1509633481_add_blocks_columns.down.sql delete mode 100644 db/migrations/1510257608_add_contracts_table.down.sql delete mode 100644 db/migrations/1510262915_add_from_to_transactions.down.sql delete mode 100644 db/migrations/1510262915_add_from_to_transactions.up.sql delete mode 100644 db/migrations/1512417153_add_abi_to_watched_contracts.down.sql delete mode 100644 db/migrations/1512417153_add_abi_to_watched_contracts.up.sql delete mode 100644 db/migrations/1512504078_add_nodes_table.down.sql delete mode 100644 db/migrations/1512507280_add_node_fk_to_blocks.down.sql delete mode 100644 db/migrations/1512507280_add_node_fk_to_blocks.up.sql delete mode 100644 db/migrations/1512595007_add_contract_hash_constraint_to_watched_contracts.down.sql delete mode 100644 db/migrations/1512595007_add_contract_hash_constraint_to_watched_contracts.up.sql delete mode 100644 db/migrations/1513029953_add_logs_table.down.sql delete mode 100644 db/migrations/1513192766_add_cascade_delete_to_transactions.down.sql delete mode 100644 db/migrations/1513192766_add_cascade_delete_to_transactions.up.sql delete mode 100644 db/migrations/1513275969_add_cascade_delete_to_blocks.up.sql delete mode 100644 db/migrations/1513613036_add_is_final_to_blocks.down.sql delete mode 100644 db/migrations/1513613036_add_is_final_to_blocks.up.sql delete mode 100644 db/migrations/1513781105_add_unique_constraint_blocks_node.down.sql delete mode 100644 db/migrations/1513781105_add_unique_constraint_blocks_node.up.sql delete mode 100644 db/migrations/1513783615_add_block_id_index_on_transactions_table.down.sql delete mode 100644 db/migrations/1513783615_add_block_id_index_on_transactions_table.up.sql delete mode 100644 db/migrations/1513783944_add_node_id_index_on_blocks_table.down.sql delete mode 100644 db/migrations/1513783944_add_node_id_index_on_blocks_table.up.sql delete mode 100644 db/migrations/1513805096_tx_to_index.down.sql delete mode 100644 db/migrations/1513805096_tx_to_index.up.sql delete mode 100644 db/migrations/1513805100_tx_from_index.down.sql delete mode 100644 db/migrations/1513805100_tx_from_index.up.sql delete mode 100644 db/migrations/1514392444_add_miner.down.sql delete mode 100644 db/migrations/1514392444_add_miner.up.sql delete mode 100644 db/migrations/1514397430_add_extra_data.down.sql delete mode 100644 db/migrations/1514397430_add_extra_data.up.sql delete mode 100644 db/migrations/1514476024_add_block_reward_uncle_reward.down.sql delete mode 100644 db/migrations/1514476024_add_block_reward_uncle_reward.up.sql delete mode 100644 db/migrations/1514502281_add_data_input_to_transactions.down.sql delete mode 100644 db/migrations/1514502281_add_data_input_to_transactions.up.sql delete mode 100644 db/migrations/1514564898_create_receipts_table.down.sql delete mode 100644 db/migrations/1514932205_add_transaction_id_index_to_receipts.down.sql delete mode 100644 db/migrations/1514932205_add_transaction_id_index_to_receipts.up.sql delete mode 100644 db/migrations/1515613181_add_fields_to_node.down.sql delete mode 100644 db/migrations/1515613181_add_fields_to_node.up.sql delete mode 100644 db/migrations/1515613715_update_node_index.down.sql delete mode 100644 db/migrations/1515613715_update_node_index.up.sql delete mode 100644 db/migrations/1516050071_add_log_fk_constraint.down.sql delete mode 100644 db/migrations/1516648743_add_log_filters.down.sql delete mode 100644 db/migrations/1516653373_add_watched_event_logs.down.sql delete mode 100644 db/migrations/1517538273_update_gas_limit_gas_used.down.sql delete mode 100644 db/migrations/1517538273_update_gas_limit_gas_used.up.sql delete mode 100644 db/migrations/1517603663_rename_block_columns.down.sql delete mode 100644 db/migrations/1517603663_rename_block_columns.up.sql delete mode 100644 db/migrations/1517605676_update_tx_table_names.down.sql delete mode 100644 db/migrations/1517605676_update_tx_table_names.up.sql delete mode 100644 db/migrations/1517854395_update_log_filters_to_block_constraint.down.sql delete mode 100644 db/migrations/1517854395_update_log_filters_to_block_constraint.up.sql delete mode 100644 db/migrations/1520289493_update_eth18_types.down.sql delete mode 100644 db/migrations/1520289493_update_eth18_types.up.sql delete mode 100644 db/migrations/1521640994_rename_node_table.down.sql delete mode 100644 db/migrations/1521640994_rename_node_table.up.sql delete mode 100644 db/migrations/1525122581_associate_receipts_with_blocks.down.sql delete mode 100644 db/migrations/1525122581_associate_receipts_with_blocks.up.sql delete mode 100644 db/migrations/1525464568_add_eth_node_fingerprint_to_blocks.down.sql delete mode 100644 db/migrations/1528317902_create_token_supply_table.down.sql delete mode 100644 db/migrations/1531758090_create_headers_table.down.sql delete mode 100644 db/migrations/1532468317_create_checked_headers_table.down.sql delete mode 100644 db/migrations/1532468318_create_maker_schema.down.sql delete mode 100644 db/migrations/1532468318_create_maker_schema.up.sql delete mode 100644 db/migrations/1532468319_create_flip_kick.down.sql delete mode 100644 db/migrations/1533844125_create_frob.down.sql delete mode 100644 db/migrations/1534275305_create_price_feeds_table.down.sql delete mode 100644 db/migrations/1534295712_create_tend.down.sql delete mode 100644 db/migrations/1534295713_create_bite.down.sql delete mode 100644 db/migrations/1534799167_create_dent.down.sql delete mode 100644 db/migrations/1535667935_create_pit_file.down.sql delete mode 100644 db/migrations/1536267596_create_vat_init.down.sql delete mode 100644 db/migrations/1536603967_create_drip_file.down.sql delete mode 100644 db/migrations/1536615440_create_deal.down.sql delete mode 100644 db/migrations/1536702963_add_price_feed_trigger.down.sql delete mode 100644 db/migrations/1536710319_create_drip_drip.down.sql delete mode 100644 db/migrations/1536765047_create_cat_file.down.sql delete mode 100644 db/migrations/1536942529_create_flop_kick.down.sql delete mode 100644 db/migrations/1538396815_create_vat_move.down.sql delete mode 100644 db/migrations/1538510582_create_vat_fold_table.down.sql delete mode 100644 db/migrations/1538671228_create_vat_heal.down.sql delete mode 100644 db/migrations/1538679495_create_vat_toll.down.sql delete mode 100644 db/migrations/1538689084_create_vat_tune.down.sql delete mode 100644 db/migrations/1539033620_create_vat_grab.down.sql delete mode 100644 db/migrations/1539276289_create_vat_flux_table.down.sql delete mode 100644 db/migrations/1539638109_create_vat_slip.down.sql delete mode 100644 db/migrations/1540297136_create_vow_flog.down.sql delete mode 100644 db/migrations/1541525500_create_flap_kick.down.sql delete mode 100644 db/migrations/1542222088_drop_pit_file_stability_fee.up.sql create mode 100644 db/migrations/20171025165407_create_blocks_table.sql rename db/migrations/{1508965325_add_columns_to_blocks.up.sql => 20171025230205_add_columns_to_blocks.sql} (52%) rename db/migrations/{1509119369_initial_transaction_table.up.sql => 20171027174929_initial_transaction_table.sql} (77%) create mode 100644 db/migrations/20171030203101_add_primary_key_to_blocks.sql rename db/migrations/{1509460207_add_block_id_to_transactions.up.sql => 20171031153007_add_block_id_to_transactions.sql} (64%) create mode 100644 db/migrations/20171031221128_add_block_index.sql rename db/migrations/{1509633481_add_blocks_columns.up.sql => 20171102153801_add_blocks_columns.sql} (52%) rename db/migrations/{1510257608_add_contracts_table.up.sql => 20171109210008_add_contracts_table.sql} (61%) create mode 100644 db/migrations/20171109222835_add_from_to_transactions.sql create mode 100644 db/migrations/20171204205233_add_abi_to_watched_contracts.sql rename db/migrations/{1512504078_add_nodes_table.up.sql => 20171205210118_add_nodes_table.sql} (76%) rename db/migrations/{1513275969_add_cascade_delete_to_blocks.down.sql => 20171205215440_add_node_fk_to_blocks.sql} (55%) create mode 100644 db/migrations/20171206221647_add_contract_hash_constraint_to_watched_contracts.sql rename db/migrations/{1513029953_add_logs_table.up.sql => 20171211230553_add_logs_table.sql} (88%) create mode 100644 db/migrations/20171213201926_add_cascade_delete_to_transactions.sql create mode 100644 db/migrations/20171214192609_add_cascade_delete_to_blocks.sql create mode 100644 db/migrations/20171218170356_add_is_final_to_blocks.sql create mode 100644 db/migrations/20171220154505_add_unique_constraint_blocks_node.sql create mode 100644 db/migrations/20171220162655_add_block_id_index_on_transactions_table.sql create mode 100644 db/migrations/20171220163224_add_node_id_index_on_blocks_table.sql create mode 100644 db/migrations/20171220222456_tx_to_index.sql create mode 100644 db/migrations/20171220222500_tx_from_index.sql create mode 100644 db/migrations/20171227173404_add_miner.sql create mode 100644 db/migrations/20171227185710_add_extra_data.sql create mode 100644 db/migrations/20171228164704_add_block_reward_uncle_reward.sql create mode 100644 db/migrations/20171229000441_add_data_input_to_transactions.sql rename db/migrations/{1514564898_create_receipts_table.up.sql => 20171229172818_create_receipts_table.sql} (88%) create mode 100644 db/migrations/20180102233005_add_transaction_id_index_to_receipts.sql create mode 100644 db/migrations/20180110203941_add_fields_to_node.sql create mode 100644 db/migrations/20180110204835_update_node_index.sql rename db/migrations/{1516050071_add_log_fk_constraint.up.sql => 20180115220111_add_log_fk_constraint.sql} (51%) rename db/migrations/{1516648743_add_log_filters.up.sql => 20180122201903_add_log_filters.sql} (86%) rename db/migrations/{1516653373_add_watched_event_logs.up.sql => 20180122213613_add_watched_event_logs.sql} (90%) create mode 100644 db/migrations/20180202032433_update_gas_limit_gas_used.sql create mode 100644 db/migrations/20180202213423_rename_block_columns.sql create mode 100644 db/migrations/20180202220756_update_tx_table_names.sql create mode 100644 db/migrations/20180205191315_update_log_filters_to_block_constraint.sql create mode 100644 db/migrations/20180305233813_update_eth18_types.sql create mode 100644 db/migrations/20180321150314_rename_node_table.sql create mode 100644 db/migrations/20180430230941_associate_receipts_with_blocks.sql rename db/migrations/{1525464568_add_eth_node_fingerprint_to_blocks.up.sql => 20180504220928_add_eth_node_fingerprint_to_blocks.sql} (75%) rename db/migrations/{1528317902_create_token_supply_table.up.sql => 20180606224502_create_token_supply_table.sql} (79%) rename db/migrations/{1531758090_create_headers_table.up.sql => 20180716182130_create_headers_table.sql} (86%) rename db/migrations/{1532468317_create_checked_headers_table.up.sql => 20180724233837_create_checked_headers_table.sql} (77%) create mode 100644 db/migrations/20180724233838_create_maker_schema.sql rename db/migrations/{1532468319_create_flip_kick.up.sql => 20180724233839_create_flip_kick.sql} (72%) rename db/migrations/{1533844125_create_frob.up.sql => 20180809214845_create_frob.sql} (71%) rename db/migrations/{1534275305_create_price_feeds_table.up.sql => 20180814213505_create_price_feeds_table.sql} (87%) rename db/migrations/{1534295712_create_tend.up.sql => 20180815031512_create_tend.sql} (81%) rename db/migrations/{1534295713_create_bite.up.sql => 20180815031513_create_bite.sql} (71%) rename db/migrations/{1534799167_create_dent.up.sql => 20180820230607_create_dent.sql} (81%) rename db/migrations/{1535667935_create_pit_file.up.sql => 20180831002535_create_pit_file.sql} (76%) rename db/migrations/{1536267596_create_vat_init.up.sql => 20180906225956_create_vat_init.sql} (64%) rename db/migrations/{1536603967_create_drip_file.up.sql => 20180910202607_create_drip_file.sql} (77%) rename db/migrations/{1536615440_create_deal.up.sql => 20180910233720_create_deal.sql} (69%) rename db/migrations/{1536702963_add_price_feed_trigger.up.sql => 20180911235603_add_price_feed_trigger.sql} (82%) rename db/migrations/{1536710319_create_drip_drip.up.sql => 20180912015839_create_drip_drip.sql} (63%) rename db/migrations/{1536765047_create_cat_file.up.sql => 20180912171047_create_cat_file.sql} (78%) rename db/migrations/{1536942529_create_flop_kick.up.sql => 20180914182849_create_flop_kick.sql} (71%) rename db/migrations/{1538396815_create_vat_move.up.sql => 20181001142655_create_vat_move.sql} (79%) rename db/migrations/{1538510582_create_vat_fold_table.up.sql => 20181002220302_create_vat_fold_table.sql} (76%) rename db/migrations/{1538671228_create_vat_heal.up.sql => 20181004184028_create_vat_heal.sql} (77%) rename db/migrations/{1538679495_create_vat_toll.up.sql => 20181004205815_create_vat_toll.sql} (67%) rename db/migrations/{1538689084_create_vat_tune.up.sql => 20181004233804_create_vat_tune.sql} (70%) rename db/migrations/{1539033620_create_vat_grab.up.sql => 20181008232020_create_vat_grab.sql} (70%) rename db/migrations/{1539276289_create_vat_flux_table.up.sql => 20181011184449_create_vat_flux_table.sql} (78%) rename db/migrations/{1539638109_create_vat_slip.up.sql => 20181015231509_create_vat_slip.sql} (67%) rename db/migrations/{1540297136_create_vow_flog.up.sql => 20181023141856_create_vow_flog.sql} (64%) rename db/migrations/{1541525500_create_flap_kick.up.sql => 20181106183140_create_flap_kick.sql} (71%) rename db/migrations/{1542222088_drop_pit_file_stability_fee.down.sql => 20181114200128_drop_pit_file_stability_fee.sql} (72%) 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, From bbb9260d136e653e0ccb8140aba72cf8c4931dde Mon Sep 17 00:00:00 2001 From: Edvard Date: Tue, 22 Jan 2019 13:16:47 +0100 Subject: [PATCH 02/10] Convert existing migrations from timestamp to versioned --- ...5407_create_blocks_table.sql => 00001_create_blocks_table.sql} | 0 ..._add_columns_to_blocks.sql => 00002_add_columns_to_blocks.sql} | 0 ..._transaction_table.sql => 00003_initial_transaction_table.sql} | 0 ...mary_key_to_blocks.sql => 00004_add_primary_key_to_blocks.sql} | 0 ...to_transactions.sql => 00005_add_block_id_to_transactions.sql} | 0 ...171031221128_add_block_index.sql => 00006_add_block_index.sql} | 0 ...153801_add_blocks_columns.sql => 00007_add_blocks_columns.sql} | 0 ...0008_add_contracts_table.sql => 00008_add_contracts_table.sql} | 0 ...rom_to_transactions.sql => 00009_add_from_to_transactions.sql} | 0 ...tched_contracts.sql => 00010_add_abi_to_watched_contracts.sql} | 0 ...171205210118_add_nodes_table.sql => 00011_add_nodes_table.sql} | 0 ..._add_node_fk_to_blocks.sql => 00012_add_node_fk_to_blocks.sql} | 0 ...> 00013_add_contract_hash_constraint_to_watched_contracts.sql} | 0 ...20171211230553_add_logs_table.sql => 00014_add_logs_table.sql} | 0 ...nsactions.sql => 00015_add_cascade_delete_to_transactions.sql} | 0 ...elete_to_blocks.sql => 00016_add_cascade_delete_to_blocks.sql} | 0 ...dd_is_final_to_blocks.sql => 00017_add_is_final_to_blocks.sql} | 0 ...locks_node.sql => 00018_add_unique_constraint_blocks_node.sql} | 0 ...ble.sql => 00019_add_block_id_index_on_transactions_table.sql} | 0 ...ocks_table.sql => 00020_add_node_id_index_on_blocks_table.sql} | 0 .../{20171220222456_tx_to_index.sql => 00021_tx_to_index.sql} | 0 .../{20171220222500_tx_from_index.sql => 00022_tx_from_index.sql} | 0 .../{20171227173404_add_miner.sql => 00023_add_miner.sql} | 0 ...20171227185710_add_extra_data.sql => 00024_add_extra_data.sql} | 0 ...d_uncle_reward.sql => 00025_add_block_reward_uncle_reward.sql} | 0 ..._transactions.sql => 00026_add_data_input_to_transactions.sql} | 0 ..._create_receipts_table.sql => 00027_create_receipts_table.sql} | 0 ...eceipts.sql => 00028_add_transaction_id_index_to_receipts.sql} | 0 ...203941_add_fields_to_node.sql => 00029_add_fields_to_node.sql} | 0 ...10204835_update_node_index.sql => 00030_update_node_index.sql} | 0 ..._add_log_fk_constraint.sql => 00031_add_log_fk_constraint.sql} | 0 ...180122201903_add_log_filters.sql => 00032_add_log_filters.sql} | 0 ...dd_watched_event_logs.sql => 00033_add_watched_event_logs.sql} | 0 ...gas_limit_gas_used.sql => 00034_update_gas_limit_gas_used.sql} | 0 ...23_rename_block_columns.sql => 00035_rename_block_columns.sql} | 0 ..._update_tx_table_names.sql => 00036_update_tx_table_names.sql} | 0 ...raint.sql => 00037_update_log_filters_to_block_constraint.sql} | 0 ...233813_update_eth18_types.sql => 00038_update_eth18_types.sql} | 0 ...21150314_rename_node_table.sql => 00039_rename_node_table.sql} | 0 ...s_with_blocks.sql => 00040_associate_receipts_with_blocks.sql} | 0 ...to_blocks.sql => 00041_add_eth_node_fingerprint_to_blocks.sql} | 0 ...token_supply_table.sql => 00042_create_token_supply_table.sql} | 0 ...30_create_headers_table.sql => 00043_create_headers_table.sql} | 0 ...d_headers_table.sql => 00044_create_checked_headers_table.sql} | 0 ...3838_create_maker_schema.sql => 00045_create_maker_schema.sql} | 0 ...0724233839_create_flip_kick.sql => 00046_create_flip_kick.sql} | 0 .../{20180809214845_create_frob.sql => 00047_create_frob.sql} | 0 ...e_price_feeds_table.sql => 00048_create_price_feeds_table.sql} | 0 .../{20180815031512_create_tend.sql => 00049_create_tend.sql} | 0 .../{20180815031513_create_bite.sql => 00050_create_bite.sql} | 0 .../{20180820230607_create_dent.sql => 00051_create_dent.sql} | 0 ...180831002535_create_pit_file.sql => 00052_create_pit_file.sql} | 0 ...180906225956_create_vat_init.sql => 00053_create_vat_init.sql} | 0 ...0910202607_create_drip_file.sql => 00054_create_drip_file.sql} | 0 .../{20180910233720_create_deal.sql => 00055_create_deal.sql} | 0 ...dd_price_feed_trigger.sql => 00056_add_price_feed_trigger.sql} | 0 ...0912015839_create_drip_drip.sql => 00057_create_drip_drip.sql} | 0 ...180912171047_create_cat_file.sql => 00058_create_cat_file.sql} | 0 ...0914182849_create_flop_kick.sql => 00059_create_flop_kick.sql} | 0 ...181001142655_create_vat_move.sql => 00060_create_vat_move.sql} | 0 ..._create_vat_fold_table.sql => 00061_create_vat_fold_table.sql} | 0 ...181004184028_create_vat_heal.sql => 00062_create_vat_heal.sql} | 0 ...181004205815_create_vat_toll.sql => 00063_create_vat_toll.sql} | 0 ...181004233804_create_vat_tune.sql => 00064_create_vat_tune.sql} | 0 ...181008232020_create_vat_grab.sql => 00065_create_vat_grab.sql} | 0 ..._create_vat_flux_table.sql => 00066_create_vat_flux_table.sql} | 0 ...181015231509_create_vat_slip.sql => 00067_create_vat_slip.sql} | 0 ...181023141856_create_vow_flog.sql => 00068_create_vow_flog.sql} | 0 ...1106183140_create_flap_kick.sql => 00069_create_flap_kick.sql} | 0 ...le_stability_fee.sql => 00070_drop_pit_file_stability_fee.sql} | 0 70 files changed, 0 insertions(+), 0 deletions(-) rename db/migrations/{20171025165407_create_blocks_table.sql => 00001_create_blocks_table.sql} (100%) rename db/migrations/{20171025230205_add_columns_to_blocks.sql => 00002_add_columns_to_blocks.sql} (100%) rename db/migrations/{20171027174929_initial_transaction_table.sql => 00003_initial_transaction_table.sql} (100%) rename db/migrations/{20171030203101_add_primary_key_to_blocks.sql => 00004_add_primary_key_to_blocks.sql} (100%) rename db/migrations/{20171031153007_add_block_id_to_transactions.sql => 00005_add_block_id_to_transactions.sql} (100%) rename db/migrations/{20171031221128_add_block_index.sql => 00006_add_block_index.sql} (100%) rename db/migrations/{20171102153801_add_blocks_columns.sql => 00007_add_blocks_columns.sql} (100%) rename db/migrations/{20171109210008_add_contracts_table.sql => 00008_add_contracts_table.sql} (100%) rename db/migrations/{20171109222835_add_from_to_transactions.sql => 00009_add_from_to_transactions.sql} (100%) rename db/migrations/{20171204205233_add_abi_to_watched_contracts.sql => 00010_add_abi_to_watched_contracts.sql} (100%) rename db/migrations/{20171205210118_add_nodes_table.sql => 00011_add_nodes_table.sql} (100%) rename db/migrations/{20171205215440_add_node_fk_to_blocks.sql => 00012_add_node_fk_to_blocks.sql} (100%) rename db/migrations/{20171206221647_add_contract_hash_constraint_to_watched_contracts.sql => 00013_add_contract_hash_constraint_to_watched_contracts.sql} (100%) rename db/migrations/{20171211230553_add_logs_table.sql => 00014_add_logs_table.sql} (100%) rename db/migrations/{20171213201926_add_cascade_delete_to_transactions.sql => 00015_add_cascade_delete_to_transactions.sql} (100%) rename db/migrations/{20171214192609_add_cascade_delete_to_blocks.sql => 00016_add_cascade_delete_to_blocks.sql} (100%) rename db/migrations/{20171218170356_add_is_final_to_blocks.sql => 00017_add_is_final_to_blocks.sql} (100%) rename db/migrations/{20171220154505_add_unique_constraint_blocks_node.sql => 00018_add_unique_constraint_blocks_node.sql} (100%) rename db/migrations/{20171220162655_add_block_id_index_on_transactions_table.sql => 00019_add_block_id_index_on_transactions_table.sql} (100%) rename db/migrations/{20171220163224_add_node_id_index_on_blocks_table.sql => 00020_add_node_id_index_on_blocks_table.sql} (100%) rename db/migrations/{20171220222456_tx_to_index.sql => 00021_tx_to_index.sql} (100%) rename db/migrations/{20171220222500_tx_from_index.sql => 00022_tx_from_index.sql} (100%) rename db/migrations/{20171227173404_add_miner.sql => 00023_add_miner.sql} (100%) rename db/migrations/{20171227185710_add_extra_data.sql => 00024_add_extra_data.sql} (100%) rename db/migrations/{20171228164704_add_block_reward_uncle_reward.sql => 00025_add_block_reward_uncle_reward.sql} (100%) rename db/migrations/{20171229000441_add_data_input_to_transactions.sql => 00026_add_data_input_to_transactions.sql} (100%) rename db/migrations/{20171229172818_create_receipts_table.sql => 00027_create_receipts_table.sql} (100%) rename db/migrations/{20180102233005_add_transaction_id_index_to_receipts.sql => 00028_add_transaction_id_index_to_receipts.sql} (100%) rename db/migrations/{20180110203941_add_fields_to_node.sql => 00029_add_fields_to_node.sql} (100%) rename db/migrations/{20180110204835_update_node_index.sql => 00030_update_node_index.sql} (100%) rename db/migrations/{20180115220111_add_log_fk_constraint.sql => 00031_add_log_fk_constraint.sql} (100%) rename db/migrations/{20180122201903_add_log_filters.sql => 00032_add_log_filters.sql} (100%) rename db/migrations/{20180122213613_add_watched_event_logs.sql => 00033_add_watched_event_logs.sql} (100%) rename db/migrations/{20180202032433_update_gas_limit_gas_used.sql => 00034_update_gas_limit_gas_used.sql} (100%) rename db/migrations/{20180202213423_rename_block_columns.sql => 00035_rename_block_columns.sql} (100%) rename db/migrations/{20180202220756_update_tx_table_names.sql => 00036_update_tx_table_names.sql} (100%) rename db/migrations/{20180205191315_update_log_filters_to_block_constraint.sql => 00037_update_log_filters_to_block_constraint.sql} (100%) rename db/migrations/{20180305233813_update_eth18_types.sql => 00038_update_eth18_types.sql} (100%) rename db/migrations/{20180321150314_rename_node_table.sql => 00039_rename_node_table.sql} (100%) rename db/migrations/{20180430230941_associate_receipts_with_blocks.sql => 00040_associate_receipts_with_blocks.sql} (100%) rename db/migrations/{20180504220928_add_eth_node_fingerprint_to_blocks.sql => 00041_add_eth_node_fingerprint_to_blocks.sql} (100%) rename db/migrations/{20180606224502_create_token_supply_table.sql => 00042_create_token_supply_table.sql} (100%) rename db/migrations/{20180716182130_create_headers_table.sql => 00043_create_headers_table.sql} (100%) rename db/migrations/{20180724233837_create_checked_headers_table.sql => 00044_create_checked_headers_table.sql} (100%) rename db/migrations/{20180724233838_create_maker_schema.sql => 00045_create_maker_schema.sql} (100%) rename db/migrations/{20180724233839_create_flip_kick.sql => 00046_create_flip_kick.sql} (100%) rename db/migrations/{20180809214845_create_frob.sql => 00047_create_frob.sql} (100%) rename db/migrations/{20180814213505_create_price_feeds_table.sql => 00048_create_price_feeds_table.sql} (100%) rename db/migrations/{20180815031512_create_tend.sql => 00049_create_tend.sql} (100%) rename db/migrations/{20180815031513_create_bite.sql => 00050_create_bite.sql} (100%) rename db/migrations/{20180820230607_create_dent.sql => 00051_create_dent.sql} (100%) rename db/migrations/{20180831002535_create_pit_file.sql => 00052_create_pit_file.sql} (100%) rename db/migrations/{20180906225956_create_vat_init.sql => 00053_create_vat_init.sql} (100%) rename db/migrations/{20180910202607_create_drip_file.sql => 00054_create_drip_file.sql} (100%) rename db/migrations/{20180910233720_create_deal.sql => 00055_create_deal.sql} (100%) rename db/migrations/{20180911235603_add_price_feed_trigger.sql => 00056_add_price_feed_trigger.sql} (100%) rename db/migrations/{20180912015839_create_drip_drip.sql => 00057_create_drip_drip.sql} (100%) rename db/migrations/{20180912171047_create_cat_file.sql => 00058_create_cat_file.sql} (100%) rename db/migrations/{20180914182849_create_flop_kick.sql => 00059_create_flop_kick.sql} (100%) rename db/migrations/{20181001142655_create_vat_move.sql => 00060_create_vat_move.sql} (100%) rename db/migrations/{20181002220302_create_vat_fold_table.sql => 00061_create_vat_fold_table.sql} (100%) rename db/migrations/{20181004184028_create_vat_heal.sql => 00062_create_vat_heal.sql} (100%) rename db/migrations/{20181004205815_create_vat_toll.sql => 00063_create_vat_toll.sql} (100%) rename db/migrations/{20181004233804_create_vat_tune.sql => 00064_create_vat_tune.sql} (100%) rename db/migrations/{20181008232020_create_vat_grab.sql => 00065_create_vat_grab.sql} (100%) rename db/migrations/{20181011184449_create_vat_flux_table.sql => 00066_create_vat_flux_table.sql} (100%) rename db/migrations/{20181015231509_create_vat_slip.sql => 00067_create_vat_slip.sql} (100%) rename db/migrations/{20181023141856_create_vow_flog.sql => 00068_create_vow_flog.sql} (100%) rename db/migrations/{20181106183140_create_flap_kick.sql => 00069_create_flap_kick.sql} (100%) rename db/migrations/{20181114200128_drop_pit_file_stability_fee.sql => 00070_drop_pit_file_stability_fee.sql} (100%) diff --git a/db/migrations/20171025165407_create_blocks_table.sql b/db/migrations/00001_create_blocks_table.sql similarity index 100% rename from db/migrations/20171025165407_create_blocks_table.sql rename to db/migrations/00001_create_blocks_table.sql diff --git a/db/migrations/20171025230205_add_columns_to_blocks.sql b/db/migrations/00002_add_columns_to_blocks.sql similarity index 100% rename from db/migrations/20171025230205_add_columns_to_blocks.sql rename to db/migrations/00002_add_columns_to_blocks.sql diff --git a/db/migrations/20171027174929_initial_transaction_table.sql b/db/migrations/00003_initial_transaction_table.sql similarity index 100% rename from db/migrations/20171027174929_initial_transaction_table.sql rename to db/migrations/00003_initial_transaction_table.sql diff --git a/db/migrations/20171030203101_add_primary_key_to_blocks.sql b/db/migrations/00004_add_primary_key_to_blocks.sql similarity index 100% rename from db/migrations/20171030203101_add_primary_key_to_blocks.sql rename to db/migrations/00004_add_primary_key_to_blocks.sql diff --git a/db/migrations/20171031153007_add_block_id_to_transactions.sql b/db/migrations/00005_add_block_id_to_transactions.sql similarity index 100% rename from db/migrations/20171031153007_add_block_id_to_transactions.sql rename to db/migrations/00005_add_block_id_to_transactions.sql diff --git a/db/migrations/20171031221128_add_block_index.sql b/db/migrations/00006_add_block_index.sql similarity index 100% rename from db/migrations/20171031221128_add_block_index.sql rename to db/migrations/00006_add_block_index.sql diff --git a/db/migrations/20171102153801_add_blocks_columns.sql b/db/migrations/00007_add_blocks_columns.sql similarity index 100% rename from db/migrations/20171102153801_add_blocks_columns.sql rename to db/migrations/00007_add_blocks_columns.sql diff --git a/db/migrations/20171109210008_add_contracts_table.sql b/db/migrations/00008_add_contracts_table.sql similarity index 100% rename from db/migrations/20171109210008_add_contracts_table.sql rename to db/migrations/00008_add_contracts_table.sql diff --git a/db/migrations/20171109222835_add_from_to_transactions.sql b/db/migrations/00009_add_from_to_transactions.sql similarity index 100% rename from db/migrations/20171109222835_add_from_to_transactions.sql rename to db/migrations/00009_add_from_to_transactions.sql diff --git a/db/migrations/20171204205233_add_abi_to_watched_contracts.sql b/db/migrations/00010_add_abi_to_watched_contracts.sql similarity index 100% rename from db/migrations/20171204205233_add_abi_to_watched_contracts.sql rename to db/migrations/00010_add_abi_to_watched_contracts.sql diff --git a/db/migrations/20171205210118_add_nodes_table.sql b/db/migrations/00011_add_nodes_table.sql similarity index 100% rename from db/migrations/20171205210118_add_nodes_table.sql rename to db/migrations/00011_add_nodes_table.sql diff --git a/db/migrations/20171205215440_add_node_fk_to_blocks.sql b/db/migrations/00012_add_node_fk_to_blocks.sql similarity index 100% rename from db/migrations/20171205215440_add_node_fk_to_blocks.sql rename to db/migrations/00012_add_node_fk_to_blocks.sql diff --git a/db/migrations/20171206221647_add_contract_hash_constraint_to_watched_contracts.sql b/db/migrations/00013_add_contract_hash_constraint_to_watched_contracts.sql similarity index 100% rename from db/migrations/20171206221647_add_contract_hash_constraint_to_watched_contracts.sql rename to db/migrations/00013_add_contract_hash_constraint_to_watched_contracts.sql diff --git a/db/migrations/20171211230553_add_logs_table.sql b/db/migrations/00014_add_logs_table.sql similarity index 100% rename from db/migrations/20171211230553_add_logs_table.sql rename to db/migrations/00014_add_logs_table.sql diff --git a/db/migrations/20171213201926_add_cascade_delete_to_transactions.sql b/db/migrations/00015_add_cascade_delete_to_transactions.sql similarity index 100% rename from db/migrations/20171213201926_add_cascade_delete_to_transactions.sql rename to db/migrations/00015_add_cascade_delete_to_transactions.sql diff --git a/db/migrations/20171214192609_add_cascade_delete_to_blocks.sql b/db/migrations/00016_add_cascade_delete_to_blocks.sql similarity index 100% rename from db/migrations/20171214192609_add_cascade_delete_to_blocks.sql rename to db/migrations/00016_add_cascade_delete_to_blocks.sql diff --git a/db/migrations/20171218170356_add_is_final_to_blocks.sql b/db/migrations/00017_add_is_final_to_blocks.sql similarity index 100% rename from db/migrations/20171218170356_add_is_final_to_blocks.sql rename to db/migrations/00017_add_is_final_to_blocks.sql diff --git a/db/migrations/20171220154505_add_unique_constraint_blocks_node.sql b/db/migrations/00018_add_unique_constraint_blocks_node.sql similarity index 100% rename from db/migrations/20171220154505_add_unique_constraint_blocks_node.sql rename to db/migrations/00018_add_unique_constraint_blocks_node.sql diff --git a/db/migrations/20171220162655_add_block_id_index_on_transactions_table.sql b/db/migrations/00019_add_block_id_index_on_transactions_table.sql similarity index 100% rename from db/migrations/20171220162655_add_block_id_index_on_transactions_table.sql rename to db/migrations/00019_add_block_id_index_on_transactions_table.sql diff --git a/db/migrations/20171220163224_add_node_id_index_on_blocks_table.sql b/db/migrations/00020_add_node_id_index_on_blocks_table.sql similarity index 100% rename from db/migrations/20171220163224_add_node_id_index_on_blocks_table.sql rename to db/migrations/00020_add_node_id_index_on_blocks_table.sql diff --git a/db/migrations/20171220222456_tx_to_index.sql b/db/migrations/00021_tx_to_index.sql similarity index 100% rename from db/migrations/20171220222456_tx_to_index.sql rename to db/migrations/00021_tx_to_index.sql diff --git a/db/migrations/20171220222500_tx_from_index.sql b/db/migrations/00022_tx_from_index.sql similarity index 100% rename from db/migrations/20171220222500_tx_from_index.sql rename to db/migrations/00022_tx_from_index.sql diff --git a/db/migrations/20171227173404_add_miner.sql b/db/migrations/00023_add_miner.sql similarity index 100% rename from db/migrations/20171227173404_add_miner.sql rename to db/migrations/00023_add_miner.sql diff --git a/db/migrations/20171227185710_add_extra_data.sql b/db/migrations/00024_add_extra_data.sql similarity index 100% rename from db/migrations/20171227185710_add_extra_data.sql rename to db/migrations/00024_add_extra_data.sql diff --git a/db/migrations/20171228164704_add_block_reward_uncle_reward.sql b/db/migrations/00025_add_block_reward_uncle_reward.sql similarity index 100% rename from db/migrations/20171228164704_add_block_reward_uncle_reward.sql rename to db/migrations/00025_add_block_reward_uncle_reward.sql diff --git a/db/migrations/20171229000441_add_data_input_to_transactions.sql b/db/migrations/00026_add_data_input_to_transactions.sql similarity index 100% rename from db/migrations/20171229000441_add_data_input_to_transactions.sql rename to db/migrations/00026_add_data_input_to_transactions.sql diff --git a/db/migrations/20171229172818_create_receipts_table.sql b/db/migrations/00027_create_receipts_table.sql similarity index 100% rename from db/migrations/20171229172818_create_receipts_table.sql rename to db/migrations/00027_create_receipts_table.sql diff --git a/db/migrations/20180102233005_add_transaction_id_index_to_receipts.sql b/db/migrations/00028_add_transaction_id_index_to_receipts.sql similarity index 100% rename from db/migrations/20180102233005_add_transaction_id_index_to_receipts.sql rename to db/migrations/00028_add_transaction_id_index_to_receipts.sql diff --git a/db/migrations/20180110203941_add_fields_to_node.sql b/db/migrations/00029_add_fields_to_node.sql similarity index 100% rename from db/migrations/20180110203941_add_fields_to_node.sql rename to db/migrations/00029_add_fields_to_node.sql diff --git a/db/migrations/20180110204835_update_node_index.sql b/db/migrations/00030_update_node_index.sql similarity index 100% rename from db/migrations/20180110204835_update_node_index.sql rename to db/migrations/00030_update_node_index.sql diff --git a/db/migrations/20180115220111_add_log_fk_constraint.sql b/db/migrations/00031_add_log_fk_constraint.sql similarity index 100% rename from db/migrations/20180115220111_add_log_fk_constraint.sql rename to db/migrations/00031_add_log_fk_constraint.sql diff --git a/db/migrations/20180122201903_add_log_filters.sql b/db/migrations/00032_add_log_filters.sql similarity index 100% rename from db/migrations/20180122201903_add_log_filters.sql rename to db/migrations/00032_add_log_filters.sql diff --git a/db/migrations/20180122213613_add_watched_event_logs.sql b/db/migrations/00033_add_watched_event_logs.sql similarity index 100% rename from db/migrations/20180122213613_add_watched_event_logs.sql rename to db/migrations/00033_add_watched_event_logs.sql diff --git a/db/migrations/20180202032433_update_gas_limit_gas_used.sql b/db/migrations/00034_update_gas_limit_gas_used.sql similarity index 100% rename from db/migrations/20180202032433_update_gas_limit_gas_used.sql rename to db/migrations/00034_update_gas_limit_gas_used.sql diff --git a/db/migrations/20180202213423_rename_block_columns.sql b/db/migrations/00035_rename_block_columns.sql similarity index 100% rename from db/migrations/20180202213423_rename_block_columns.sql rename to db/migrations/00035_rename_block_columns.sql diff --git a/db/migrations/20180202220756_update_tx_table_names.sql b/db/migrations/00036_update_tx_table_names.sql similarity index 100% rename from db/migrations/20180202220756_update_tx_table_names.sql rename to db/migrations/00036_update_tx_table_names.sql diff --git a/db/migrations/20180205191315_update_log_filters_to_block_constraint.sql b/db/migrations/00037_update_log_filters_to_block_constraint.sql similarity index 100% rename from db/migrations/20180205191315_update_log_filters_to_block_constraint.sql rename to db/migrations/00037_update_log_filters_to_block_constraint.sql diff --git a/db/migrations/20180305233813_update_eth18_types.sql b/db/migrations/00038_update_eth18_types.sql similarity index 100% rename from db/migrations/20180305233813_update_eth18_types.sql rename to db/migrations/00038_update_eth18_types.sql diff --git a/db/migrations/20180321150314_rename_node_table.sql b/db/migrations/00039_rename_node_table.sql similarity index 100% rename from db/migrations/20180321150314_rename_node_table.sql rename to db/migrations/00039_rename_node_table.sql diff --git a/db/migrations/20180430230941_associate_receipts_with_blocks.sql b/db/migrations/00040_associate_receipts_with_blocks.sql similarity index 100% rename from db/migrations/20180430230941_associate_receipts_with_blocks.sql rename to db/migrations/00040_associate_receipts_with_blocks.sql diff --git a/db/migrations/20180504220928_add_eth_node_fingerprint_to_blocks.sql b/db/migrations/00041_add_eth_node_fingerprint_to_blocks.sql similarity index 100% rename from db/migrations/20180504220928_add_eth_node_fingerprint_to_blocks.sql rename to db/migrations/00041_add_eth_node_fingerprint_to_blocks.sql diff --git a/db/migrations/20180606224502_create_token_supply_table.sql b/db/migrations/00042_create_token_supply_table.sql similarity index 100% rename from db/migrations/20180606224502_create_token_supply_table.sql rename to db/migrations/00042_create_token_supply_table.sql diff --git a/db/migrations/20180716182130_create_headers_table.sql b/db/migrations/00043_create_headers_table.sql similarity index 100% rename from db/migrations/20180716182130_create_headers_table.sql rename to db/migrations/00043_create_headers_table.sql diff --git a/db/migrations/20180724233837_create_checked_headers_table.sql b/db/migrations/00044_create_checked_headers_table.sql similarity index 100% rename from db/migrations/20180724233837_create_checked_headers_table.sql rename to db/migrations/00044_create_checked_headers_table.sql diff --git a/db/migrations/20180724233838_create_maker_schema.sql b/db/migrations/00045_create_maker_schema.sql similarity index 100% rename from db/migrations/20180724233838_create_maker_schema.sql rename to db/migrations/00045_create_maker_schema.sql diff --git a/db/migrations/20180724233839_create_flip_kick.sql b/db/migrations/00046_create_flip_kick.sql similarity index 100% rename from db/migrations/20180724233839_create_flip_kick.sql rename to db/migrations/00046_create_flip_kick.sql diff --git a/db/migrations/20180809214845_create_frob.sql b/db/migrations/00047_create_frob.sql similarity index 100% rename from db/migrations/20180809214845_create_frob.sql rename to db/migrations/00047_create_frob.sql diff --git a/db/migrations/20180814213505_create_price_feeds_table.sql b/db/migrations/00048_create_price_feeds_table.sql similarity index 100% rename from db/migrations/20180814213505_create_price_feeds_table.sql rename to db/migrations/00048_create_price_feeds_table.sql diff --git a/db/migrations/20180815031512_create_tend.sql b/db/migrations/00049_create_tend.sql similarity index 100% rename from db/migrations/20180815031512_create_tend.sql rename to db/migrations/00049_create_tend.sql diff --git a/db/migrations/20180815031513_create_bite.sql b/db/migrations/00050_create_bite.sql similarity index 100% rename from db/migrations/20180815031513_create_bite.sql rename to db/migrations/00050_create_bite.sql diff --git a/db/migrations/20180820230607_create_dent.sql b/db/migrations/00051_create_dent.sql similarity index 100% rename from db/migrations/20180820230607_create_dent.sql rename to db/migrations/00051_create_dent.sql diff --git a/db/migrations/20180831002535_create_pit_file.sql b/db/migrations/00052_create_pit_file.sql similarity index 100% rename from db/migrations/20180831002535_create_pit_file.sql rename to db/migrations/00052_create_pit_file.sql diff --git a/db/migrations/20180906225956_create_vat_init.sql b/db/migrations/00053_create_vat_init.sql similarity index 100% rename from db/migrations/20180906225956_create_vat_init.sql rename to db/migrations/00053_create_vat_init.sql diff --git a/db/migrations/20180910202607_create_drip_file.sql b/db/migrations/00054_create_drip_file.sql similarity index 100% rename from db/migrations/20180910202607_create_drip_file.sql rename to db/migrations/00054_create_drip_file.sql diff --git a/db/migrations/20180910233720_create_deal.sql b/db/migrations/00055_create_deal.sql similarity index 100% rename from db/migrations/20180910233720_create_deal.sql rename to db/migrations/00055_create_deal.sql diff --git a/db/migrations/20180911235603_add_price_feed_trigger.sql b/db/migrations/00056_add_price_feed_trigger.sql similarity index 100% rename from db/migrations/20180911235603_add_price_feed_trigger.sql rename to db/migrations/00056_add_price_feed_trigger.sql diff --git a/db/migrations/20180912015839_create_drip_drip.sql b/db/migrations/00057_create_drip_drip.sql similarity index 100% rename from db/migrations/20180912015839_create_drip_drip.sql rename to db/migrations/00057_create_drip_drip.sql diff --git a/db/migrations/20180912171047_create_cat_file.sql b/db/migrations/00058_create_cat_file.sql similarity index 100% rename from db/migrations/20180912171047_create_cat_file.sql rename to db/migrations/00058_create_cat_file.sql diff --git a/db/migrations/20180914182849_create_flop_kick.sql b/db/migrations/00059_create_flop_kick.sql similarity index 100% rename from db/migrations/20180914182849_create_flop_kick.sql rename to db/migrations/00059_create_flop_kick.sql diff --git a/db/migrations/20181001142655_create_vat_move.sql b/db/migrations/00060_create_vat_move.sql similarity index 100% rename from db/migrations/20181001142655_create_vat_move.sql rename to db/migrations/00060_create_vat_move.sql diff --git a/db/migrations/20181002220302_create_vat_fold_table.sql b/db/migrations/00061_create_vat_fold_table.sql similarity index 100% rename from db/migrations/20181002220302_create_vat_fold_table.sql rename to db/migrations/00061_create_vat_fold_table.sql diff --git a/db/migrations/20181004184028_create_vat_heal.sql b/db/migrations/00062_create_vat_heal.sql similarity index 100% rename from db/migrations/20181004184028_create_vat_heal.sql rename to db/migrations/00062_create_vat_heal.sql diff --git a/db/migrations/20181004205815_create_vat_toll.sql b/db/migrations/00063_create_vat_toll.sql similarity index 100% rename from db/migrations/20181004205815_create_vat_toll.sql rename to db/migrations/00063_create_vat_toll.sql diff --git a/db/migrations/20181004233804_create_vat_tune.sql b/db/migrations/00064_create_vat_tune.sql similarity index 100% rename from db/migrations/20181004233804_create_vat_tune.sql rename to db/migrations/00064_create_vat_tune.sql diff --git a/db/migrations/20181008232020_create_vat_grab.sql b/db/migrations/00065_create_vat_grab.sql similarity index 100% rename from db/migrations/20181008232020_create_vat_grab.sql rename to db/migrations/00065_create_vat_grab.sql diff --git a/db/migrations/20181011184449_create_vat_flux_table.sql b/db/migrations/00066_create_vat_flux_table.sql similarity index 100% rename from db/migrations/20181011184449_create_vat_flux_table.sql rename to db/migrations/00066_create_vat_flux_table.sql diff --git a/db/migrations/20181015231509_create_vat_slip.sql b/db/migrations/00067_create_vat_slip.sql similarity index 100% rename from db/migrations/20181015231509_create_vat_slip.sql rename to db/migrations/00067_create_vat_slip.sql diff --git a/db/migrations/20181023141856_create_vow_flog.sql b/db/migrations/00068_create_vow_flog.sql similarity index 100% rename from db/migrations/20181023141856_create_vow_flog.sql rename to db/migrations/00068_create_vow_flog.sql diff --git a/db/migrations/20181106183140_create_flap_kick.sql b/db/migrations/00069_create_flap_kick.sql similarity index 100% rename from db/migrations/20181106183140_create_flap_kick.sql rename to db/migrations/00069_create_flap_kick.sql diff --git a/db/migrations/20181114200128_drop_pit_file_stability_fee.sql b/db/migrations/00070_drop_pit_file_stability_fee.sql similarity index 100% rename from db/migrations/20181114200128_drop_pit_file_stability_fee.sql rename to db/migrations/00070_drop_pit_file_stability_fee.sql From 8de6fc45e1149a74db22c86ea3360b279c433095 Mon Sep 17 00:00:00 2001 From: Edvard Date: Tue, 22 Jan 2019 15:07:11 +0100 Subject: [PATCH 03/10] Remove tx from migrations (goose does it automagically) --- db/migrations/00001_create_blocks_table.sql | 4 ++-- db/migrations/00003_initial_transaction_table.sql | 4 ++-- db/migrations/00004_add_primary_key_to_blocks.sql | 4 ++-- .../00005_add_block_id_to_transactions.sql | 4 ++-- db/migrations/00006_add_block_index.sql | 2 +- db/migrations/00007_add_blocks_columns.sql | 4 ++-- db/migrations/00008_add_contracts_table.sql | 4 ++-- db/migrations/00009_add_from_to_transactions.sql | 4 ++-- .../00010_add_abi_to_watched_contracts.sql | 2 +- db/migrations/00011_add_nodes_table.sql | 2 +- db/migrations/00012_add_node_fk_to_blocks.sql | 2 +- ...ntract_hash_constraint_to_watched_contracts.sql | 2 +- db/migrations/00014_add_logs_table.sql | 2 +- .../00015_add_cascade_delete_to_transactions.sql | 8 -------- .../00016_add_cascade_delete_to_blocks.sql | 8 -------- db/migrations/00017_add_is_final_to_blocks.sql | 2 +- .../00018_add_unique_constraint_blocks_node.sql | 2 +- ...19_add_block_id_index_on_transactions_table.sql | 2 +- .../00020_add_node_id_index_on_blocks_table.sql | 2 +- db/migrations/00021_tx_to_index.sql | 2 +- db/migrations/00022_tx_from_index.sql | 2 +- db/migrations/00023_add_miner.sql | 2 +- db/migrations/00024_add_extra_data.sql | 2 +- .../00026_add_data_input_to_transactions.sql | 2 +- db/migrations/00027_create_receipts_table.sql | 3 --- db/migrations/00029_add_fields_to_node.sql | 2 +- db/migrations/00030_update_node_index.sql | 8 -------- db/migrations/00031_add_log_fk_constraint.sql | 6 ------ db/migrations/00032_add_log_filters.sql | 2 +- db/migrations/00034_update_gas_limit_gas_used.sql | 7 ------- db/migrations/00035_rename_block_columns.sql | 14 -------------- db/migrations/00036_update_tx_table_names.sql | 5 ----- ...0037_update_log_filters_to_block_constraint.sql | 5 ----- db/migrations/00038_update_eth18_types.sql | 1 - db/migrations/00039_rename_node_table.sql | 4 ---- .../00040_associate_receipts_with_blocks.sql | 8 -------- .../00041_add_eth_node_fingerprint_to_blocks.sql | 5 +---- db/migrations/00042_create_token_supply_table.sql | 5 ++--- db/migrations/00043_create_headers_table.sql | 3 ++- .../00044_create_checked_headers_table.sql | 2 +- db/migrations/00045_create_maker_schema.sql | 1 - db/migrations/00046_create_flip_kick.sql | 3 ++- db/migrations/00047_create_frob.sql | 3 ++- db/migrations/00048_create_price_feeds_table.sql | 3 ++- db/migrations/00049_create_tend.sql | 2 +- db/migrations/00050_create_bite.sql | 3 ++- db/migrations/00052_create_pit_file.sql | 3 ++- db/migrations/00053_create_vat_init.sql | 1 + db/migrations/00054_create_drip_file.sql | 3 ++- db/migrations/00055_create_deal.sql | 2 +- db/migrations/00056_add_price_feed_trigger.sql | 2 ++ db/migrations/00057_create_drip_drip.sql | 3 ++- db/migrations/00058_create_cat_file.sql | 3 ++- db/migrations/00059_create_flop_kick.sql | 3 ++- db/migrations/00060_create_vat_move.sql | 2 +- db/migrations/00063_create_vat_toll.sql | 3 ++- db/migrations/00064_create_vat_tune.sql | 3 ++- db/migrations/00065_create_vat_grab.sql | 3 ++- db/migrations/00067_create_vat_slip.sql | 3 ++- db/migrations/00068_create_vow_flog.sql | 3 ++- db/migrations/00069_create_flap_kick.sql | 3 ++- .../00070_drop_pit_file_stability_fee.sql | 2 +- 62 files changed, 74 insertions(+), 137 deletions(-) diff --git a/db/migrations/00001_create_blocks_table.sql b/db/migrations/00001_create_blocks_table.sql index 3e42ae83..f5fe43a6 100644 --- a/db/migrations/00001_create_blocks_table.sql +++ b/db/migrations/00001_create_blocks_table.sql @@ -2,8 +2,8 @@ CREATE TABLE public.blocks ( block_number BIGINT -) +); -- +goose Down -DROP TABLE public.blocks +DROP TABLE public.blocks; diff --git a/db/migrations/00003_initial_transaction_table.sql b/db/migrations/00003_initial_transaction_table.sql index e4cfafe5..ba6b06a0 100644 --- a/db/migrations/00003_initial_transaction_table.sql +++ b/db/migrations/00003_initial_transaction_table.sql @@ -8,7 +8,7 @@ CREATE TABLE transactions tx_gaslimit NUMERIC, tx_gasprice NUMERIC, tx_value NUMERIC -) +); -- +goose Down -DROP TABLE transactions \ No newline at end of file +DROP TABLE transactions; diff --git a/db/migrations/00004_add_primary_key_to_blocks.sql b/db/migrations/00004_add_primary_key_to_blocks.sql index 274cd918..0f336243 100644 --- a/db/migrations/00004_add_primary_key_to_blocks.sql +++ b/db/migrations/00004_add_primary_key_to_blocks.sql @@ -1,5 +1,5 @@ -- +goose Up -ALTER TABLE blocks ADD COLUMN id SERIAL PRIMARY KEY +ALTER TABLE blocks ADD COLUMN id SERIAL PRIMARY KEY; -- +goose Down -ALTER TABLE blocks DROP id \ No newline at end of file +ALTER TABLE blocks DROP id; diff --git a/db/migrations/00005_add_block_id_to_transactions.sql b/db/migrations/00005_add_block_id_to_transactions.sql index 7e782019..08e5002a 100644 --- a/db/migrations/00005_add_block_id_to_transactions.sql +++ b/db/migrations/00005_add_block_id_to_transactions.sql @@ -3,9 +3,9 @@ ALTER TABLE transactions ADD COLUMN block_id INTEGER NOT NULL, ADD CONSTRAINT fk_test FOREIGN KEY (block_id) - REFERENCES blocks (id) + REFERENCES blocks (id); -- +goose Down ALTER TABLE transactions - DROP COLUMN block_id \ No newline at end of file + DROP COLUMN block_id; diff --git a/db/migrations/00006_add_block_index.sql b/db/migrations/00006_add_block_index.sql index 3dde5477..e04815ee 100644 --- a/db/migrations/00006_add_block_index.sql +++ b/db/migrations/00006_add_block_index.sql @@ -3,4 +3,4 @@ CREATE INDEX block_number_index ON blocks (block_number); -- +goose Down -DROP INDEX block_number_index; \ No newline at end of file +DROP INDEX block_number_index; diff --git a/db/migrations/00007_add_blocks_columns.sql b/db/migrations/00007_add_blocks_columns.sql index 0cca77a5..f12c6a5d 100644 --- a/db/migrations/00007_add_blocks_columns.sql +++ b/db/migrations/00007_add_blocks_columns.sql @@ -5,7 +5,7 @@ ALTER TABLE blocks ADD COLUMN block_nonce VARCHAR(20), ADD COLUMN block_parenthash VARCHAR(66), ADD COLUMN block_size BIGINT, - ADD COLUMN uncle_hash VARCHAR(66) + ADD COLUMN uncle_hash VARCHAR(66); -- +goose Down @@ -15,4 +15,4 @@ ALTER TABLE blocks drop COLUMN block_nonce, drop COLUMN block_parenthash, drop COLUMN block_size, - drop COLUMN uncle_hash \ No newline at end of file + drop COLUMN uncle_hash; diff --git a/db/migrations/00008_add_contracts_table.sql b/db/migrations/00008_add_contracts_table.sql index 71d263f5..d5016555 100644 --- a/db/migrations/00008_add_contracts_table.sql +++ b/db/migrations/00008_add_contracts_table.sql @@ -3,7 +3,7 @@ CREATE TABLE watched_contracts ( contract_id SERIAL PRIMARY KEY, contract_hash VARCHAR(66) -) +); -- +goose Down -DROP TABLE watched_contracts \ No newline at end of file +DROP TABLE watched_contracts; diff --git a/db/migrations/00009_add_from_to_transactions.sql b/db/migrations/00009_add_from_to_transactions.sql index 26c765e2..3311b7e4 100644 --- a/db/migrations/00009_add_from_to_transactions.sql +++ b/db/migrations/00009_add_from_to_transactions.sql @@ -1,8 +1,8 @@ -- +goose Up ALTER TABLE transactions - ADD COLUMN tx_from VARCHAR(66) + ADD COLUMN tx_from VARCHAR(66); -- +goose Down ALTER TABLE transactions - DROP COLUMN tx_from + DROP COLUMN tx_from; diff --git a/db/migrations/00010_add_abi_to_watched_contracts.sql b/db/migrations/00010_add_abi_to_watched_contracts.sql index 5146a059..4520b9b7 100644 --- a/db/migrations/00010_add_abi_to_watched_contracts.sql +++ b/db/migrations/00010_add_abi_to_watched_contracts.sql @@ -4,4 +4,4 @@ ALTER TABLE watched_contracts -- +goose Down ALTER TABLE watched_contracts - DROP COLUMN contract_abi; \ No newline at end of file + DROP COLUMN contract_abi; diff --git a/db/migrations/00011_add_nodes_table.sql b/db/migrations/00011_add_nodes_table.sql index 86da63e5..46f1d51d 100644 --- a/db/migrations/00011_add_nodes_table.sql +++ b/db/migrations/00011_add_nodes_table.sql @@ -7,4 +7,4 @@ CREATE TABLE nodes ( ); -- +goose Down -DROP TABLE nodes; \ No newline at end of file +DROP TABLE nodes; diff --git a/db/migrations/00012_add_node_fk_to_blocks.sql b/db/migrations/00012_add_node_fk_to_blocks.sql index 9af8bb37..6f658caa 100644 --- a/db/migrations/00012_add_node_fk_to_blocks.sql +++ b/db/migrations/00012_add_node_fk_to_blocks.sql @@ -7,4 +7,4 @@ REFERENCES nodes (id); -- +goose Down ALTER TABLE blocks - DROP COLUMN node_id; \ No newline at end of file + DROP COLUMN node_id; diff --git a/db/migrations/00013_add_contract_hash_constraint_to_watched_contracts.sql b/db/migrations/00013_add_contract_hash_constraint_to_watched_contracts.sql index d3ff3158..4f252cce 100644 --- a/db/migrations/00013_add_contract_hash_constraint_to_watched_contracts.sql +++ b/db/migrations/00013_add_contract_hash_constraint_to_watched_contracts.sql @@ -5,4 +5,4 @@ ALTER TABLE watched_contracts -- +goose Down ALTER TABLE watched_contracts - DROP CONSTRAINT contract_hash_uc; \ No newline at end of file + DROP CONSTRAINT contract_hash_uc; diff --git a/db/migrations/00014_add_logs_table.sql b/db/migrations/00014_add_logs_table.sql index c269fc07..f85d35bd 100644 --- a/db/migrations/00014_add_logs_table.sql +++ b/db/migrations/00014_add_logs_table.sql @@ -16,4 +16,4 @@ CREATE TABLE logs ( -- +goose Down -DROP TABLE logs; \ No newline at end of file +DROP TABLE logs; diff --git a/db/migrations/00015_add_cascade_delete_to_transactions.sql b/db/migrations/00015_add_cascade_delete_to_transactions.sql index 7d833d19..f10d52dd 100644 --- a/db/migrations/00015_add_cascade_delete_to_transactions.sql +++ b/db/migrations/00015_add_cascade_delete_to_transactions.sql @@ -1,6 +1,4 @@ -- +goose Up -BEGIN; - ALTER TABLE transactions DROP CONSTRAINT fk_test; @@ -10,12 +8,8 @@ FOREIGN KEY (block_id) REFERENCES blocks (id) ON DELETE CASCADE; -COMMIT; - -- +goose Down -BEGIN; - ALTER TABLE transactions DROP CONSTRAINT blocks_fk; @@ -23,5 +17,3 @@ 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/00016_add_cascade_delete_to_blocks.sql b/db/migrations/00016_add_cascade_delete_to_blocks.sql index 1b4a2939..5a0a7e5f 100644 --- a/db/migrations/00016_add_cascade_delete_to_blocks.sql +++ b/db/migrations/00016_add_cascade_delete_to_blocks.sql @@ -1,6 +1,4 @@ -- +goose Up -BEGIN; - ALTER TABLE blocks DROP CONSTRAINT node_fk; @@ -10,11 +8,7 @@ FOREIGN KEY (node_id) REFERENCES nodes (id) ON DELETE CASCADE; -COMMIT; - -- +goose Down -BEGIN; - ALTER TABLE blocks DROP CONSTRAINT node_fk; @@ -22,5 +16,3 @@ 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/00017_add_is_final_to_blocks.sql b/db/migrations/00017_add_is_final_to_blocks.sql index 21f5b7ad..bbb27d55 100644 --- a/db/migrations/00017_add_is_final_to_blocks.sql +++ b/db/migrations/00017_add_is_final_to_blocks.sql @@ -4,4 +4,4 @@ ALTER TABLE blocks -- +goose Down ALTER TABLE blocks - DROP COLUMN is_final; \ No newline at end of file + DROP COLUMN is_final; diff --git a/db/migrations/00018_add_unique_constraint_blocks_node.sql b/db/migrations/00018_add_unique_constraint_blocks_node.sql index 6fd23743..e66e345f 100644 --- a/db/migrations/00018_add_unique_constraint_blocks_node.sql +++ b/db/migrations/00018_add_unique_constraint_blocks_node.sql @@ -4,4 +4,4 @@ ALTER TABLE blocks -- +goose Down ALTER TABLE blocks - DROP CONSTRAINT node_id_block_number_uc; \ No newline at end of file + DROP CONSTRAINT node_id_block_number_uc; diff --git a/db/migrations/00019_add_block_id_index_on_transactions_table.sql b/db/migrations/00019_add_block_id_index_on_transactions_table.sql index feaa1882..318cc9be 100644 --- a/db/migrations/00019_add_block_id_index_on_transactions_table.sql +++ b/db/migrations/00019_add_block_id_index_on_transactions_table.sql @@ -2,4 +2,4 @@ CREATE INDEX block_id_index ON transactions (block_id); -- +goose Down -DROP INDEX block_id_index; \ No newline at end of file +DROP INDEX block_id_index; diff --git a/db/migrations/00020_add_node_id_index_on_blocks_table.sql b/db/migrations/00020_add_node_id_index_on_blocks_table.sql index 915ef645..bab71f97 100644 --- a/db/migrations/00020_add_node_id_index_on_blocks_table.sql +++ b/db/migrations/00020_add_node_id_index_on_blocks_table.sql @@ -2,4 +2,4 @@ CREATE INDEX node_id_index ON blocks (node_id); -- +goose Down -DROP INDEX node_id_index; \ No newline at end of file +DROP INDEX node_id_index; diff --git a/db/migrations/00021_tx_to_index.sql b/db/migrations/00021_tx_to_index.sql index 78139346..fa50de5e 100644 --- a/db/migrations/00021_tx_to_index.sql +++ b/db/migrations/00021_tx_to_index.sql @@ -2,4 +2,4 @@ CREATE INDEX tx_to_index ON transactions(tx_to); -- +goose Down -DROP INDEX tx_to_index; \ No newline at end of file +DROP INDEX tx_to_index; diff --git a/db/migrations/00022_tx_from_index.sql b/db/migrations/00022_tx_from_index.sql index a4a9b76c..6d052bae 100644 --- a/db/migrations/00022_tx_from_index.sql +++ b/db/migrations/00022_tx_from_index.sql @@ -2,4 +2,4 @@ CREATE INDEX tx_from_index ON transactions(tx_from); -- +goose Down -DROP INDEX tx_from_index; \ No newline at end of file +DROP INDEX tx_from_index; diff --git a/db/migrations/00023_add_miner.sql b/db/migrations/00023_add_miner.sql index f55ae6e6..da1e120a 100644 --- a/db/migrations/00023_add_miner.sql +++ b/db/migrations/00023_add_miner.sql @@ -4,4 +4,4 @@ ALTER TABLE blocks -- +goose Down ALTER TABLE blocks - DROP COLUMN block_miner; \ No newline at end of file + DROP COLUMN block_miner; diff --git a/db/migrations/00024_add_extra_data.sql b/db/migrations/00024_add_extra_data.sql index 7aabca52..66ff016b 100644 --- a/db/migrations/00024_add_extra_data.sql +++ b/db/migrations/00024_add_extra_data.sql @@ -4,4 +4,4 @@ ALTER TABLE blocks -- +goose Down ALTER TABLE blocks - DROP COLUMN block_extra_data; \ No newline at end of file + DROP COLUMN block_extra_data; diff --git a/db/migrations/00026_add_data_input_to_transactions.sql b/db/migrations/00026_add_data_input_to_transactions.sql index 549cec6c..454dfa16 100644 --- a/db/migrations/00026_add_data_input_to_transactions.sql +++ b/db/migrations/00026_add_data_input_to_transactions.sql @@ -4,4 +4,4 @@ ALTER TABLE transactions -- +goose Down ALTER TABLE transactions - DROP COLUMN tx_input_data; \ No newline at end of file + DROP COLUMN tx_input_data; diff --git a/db/migrations/00027_create_receipts_table.sql b/db/migrations/00027_create_receipts_table.sql index 686a6d9b..53ef4276 100644 --- a/db/migrations/00027_create_receipts_table.sql +++ b/db/migrations/00027_create_receipts_table.sql @@ -15,8 +15,5 @@ CREATE TABLE receipts ); - - -- +goose Down DROP TABLE receipts; - diff --git a/db/migrations/00029_add_fields_to_node.sql b/db/migrations/00029_add_fields_to_node.sql index f5383880..b4dc223f 100644 --- a/db/migrations/00029_add_fields_to_node.sql +++ b/db/migrations/00029_add_fields_to_node.sql @@ -6,4 +6,4 @@ ALTER TABLE nodes -- +goose Down ALTER TABLE nodes DROP COLUMN node_id, - DROP COLUMN client_name; \ No newline at end of file + DROP COLUMN client_name; diff --git a/db/migrations/00030_update_node_index.sql b/db/migrations/00030_update_node_index.sql index c783b04f..02ad2b2d 100644 --- a/db/migrations/00030_update_node_index.sql +++ b/db/migrations/00030_update_node_index.sql @@ -1,22 +1,14 @@ -- +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/00031_add_log_fk_constraint.sql b/db/migrations/00031_add_log_fk_constraint.sql index 22cae14e..a31701b1 100644 --- a/db/migrations/00031_add_log_fk_constraint.sql +++ b/db/migrations/00031_add_log_fk_constraint.sql @@ -1,5 +1,4 @@ -- +goose Up -BEGIN; ALTER TABLE logs DROP CONSTRAINT log_uc; @@ -12,11 +11,8 @@ FOREIGN KEY (receipt_id) REFERENCES receipts (id) ON DELETE CASCADE; -COMMIT; -- +goose Down -BEGIN; - ALTER TABLE logs DROP CONSTRAINT receipts_fk; @@ -25,5 +21,3 @@ ALTER TABLE logs ALTER TABLE logs ADD CONSTRAINT log_uc UNIQUE (block_number, index); - -COMMIT; \ No newline at end of file diff --git a/db/migrations/00032_add_log_filters.sql b/db/migrations/00032_add_log_filters.sql index 371d3d70..0367f5e5 100644 --- a/db/migrations/00032_add_log_filters.sql +++ b/db/migrations/00032_add_log_filters.sql @@ -13,4 +13,4 @@ CREATE TABLE log_filters ( ); -- +goose Down -DROP TABLE log_filters; \ No newline at end of file +DROP TABLE log_filters; diff --git a/db/migrations/00034_update_gas_limit_gas_used.sql b/db/migrations/00034_update_gas_limit_gas_used.sql index 798977fe..276de18e 100644 --- a/db/migrations/00034_update_gas_limit_gas_used.sql +++ b/db/migrations/00034_update_gas_limit_gas_used.sql @@ -1,5 +1,4 @@ -- +goose Up -BEGIN; ALTER TABLE blocks ALTER COLUMN block_gaslimit TYPE BIGINT USING block_gaslimit :: BIGINT; @@ -15,12 +14,8 @@ ALTER TABLE blocks 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; @@ -35,5 +30,3 @@ ALTER TABLE blocks 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/00035_rename_block_columns.sql b/db/migrations/00035_rename_block_columns.sql index e0645838..d093ddb4 100644 --- a/db/migrations/00035_rename_block_columns.sql +++ b/db/migrations/00035_rename_block_columns.sql @@ -1,5 +1,4 @@ -- +goose Up -BEGIN; ALTER TABLE blocks RENAME COLUMN block_number TO number; @@ -38,21 +37,9 @@ ALTER TABLE blocks ALTER TABLE blocks RENAME COLUMN block_uncles_reward TO uncles_reward; -COMMIT; - - - - - - - - - - -- +goose Down -BEGIN; ALTER TABLE blocks RENAME COLUMN number TO block_number; @@ -91,4 +78,3 @@ ALTER TABLE blocks ALTER TABLE blocks RENAME COLUMN uncles_reward TO block_uncles_reward; -COMMIT; \ No newline at end of file diff --git a/db/migrations/00036_update_tx_table_names.sql b/db/migrations/00036_update_tx_table_names.sql index 8c463907..41848828 100644 --- a/db/migrations/00036_update_tx_table_names.sql +++ b/db/migrations/00036_update_tx_table_names.sql @@ -1,5 +1,4 @@ -- +goose Up -BEGIN; ALTER TABLE transactions RENAME COLUMN tx_hash TO hash; @@ -17,12 +16,9 @@ ALTER TABLE transactions 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; @@ -40,4 +36,3 @@ ALTER TABLE transactions ALTER TABLE transactions RENAME COLUMN input_data TO tx_input_data; -COMMIT; diff --git a/db/migrations/00037_update_log_filters_to_block_constraint.sql b/db/migrations/00037_update_log_filters_to_block_constraint.sql index 025d681e..512a44db 100644 --- a/db/migrations/00037_update_log_filters_to_block_constraint.sql +++ b/db/migrations/00037_update_log_filters_to_block_constraint.sql @@ -1,19 +1,14 @@ -- +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/00038_update_eth18_types.sql b/db/migrations/00038_update_eth18_types.sql index b81f5980..3389d1aa 100644 --- a/db/migrations/00038_update_eth18_types.sql +++ b/db/migrations/00038_update_eth18_types.sql @@ -4,6 +4,5 @@ ALTER TABLE blocks -- +goose Down --- +goose Up ALTER TABLE blocks ALTER COLUMN size TYPE BIGINT USING size::BIGINT; diff --git a/db/migrations/00039_rename_node_table.sql b/db/migrations/00039_rename_node_table.sql index 4e4c216f..061fda57 100644 --- a/db/migrations/00039_rename_node_table.sql +++ b/db/migrations/00039_rename_node_table.sql @@ -1,5 +1,4 @@ -- +goose Up -BEGIN; ALTER TABLE public.nodes RENAME TO eth_nodes; ALTER TABLE public.eth_nodes RENAME COLUMN node_id TO eth_node_id; @@ -19,10 +18,8 @@ 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; @@ -44,4 +41,3 @@ 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/00040_associate_receipts_with_blocks.sql b/db/migrations/00040_associate_receipts_with_blocks.sql index 1393af19..dea130fb 100644 --- a/db/migrations/00040_associate_receipts_with_blocks.sql +++ b/db/migrations/00040_associate_receipts_with_blocks.sql @@ -1,6 +1,4 @@ -- +goose Up -BEGIN; - ALTER TABLE receipts ADD COLUMN block_id INT; @@ -21,12 +19,8 @@ ON DELETE CASCADE; ALTER TABLE receipts DROP COLUMN transaction_id; -COMMIT; - -- +goose Down -BEGIN; - ALTER TABLE receipts ADD COLUMN transaction_id INT; @@ -46,5 +40,3 @@ ON DELETE CASCADE; ALTER TABLE receipts DROP COLUMN block_id; - -COMMIT; \ No newline at end of file diff --git a/db/migrations/00041_add_eth_node_fingerprint_to_blocks.sql b/db/migrations/00041_add_eth_node_fingerprint_to_blocks.sql index 382fec3c..5c48c03e 100644 --- a/db/migrations/00041_add_eth_node_fingerprint_to_blocks.sql +++ b/db/migrations/00041_add_eth_node_fingerprint_to_blocks.sql @@ -1,6 +1,4 @@ -- +goose Up -BEGIN; - ALTER TABLE blocks ADD COLUMN eth_node_fingerprint VARCHAR(128); @@ -12,8 +10,7 @@ UPDATE blocks ALTER TABLE blocks ALTER COLUMN eth_node_fingerprint SET NOT NULL; -COMMIT; -- +goose Down ALTER TABLE blocks - DROP COLUMN eth_node_fingerprint; \ No newline at end of file + DROP COLUMN eth_node_fingerprint; diff --git a/db/migrations/00042_create_token_supply_table.sql b/db/migrations/00042_create_token_supply_table.sql index f60bd064..5caf36fb 100644 --- a/db/migrations/00042_create_token_supply_table.sql +++ b/db/migrations/00042_create_token_supply_table.sql @@ -7,9 +7,8 @@ CREATE TABLE token_supply ( CONSTRAINT blocks_fk FOREIGN KEY (block_id) REFERENCES blocks (id) ON DELETE CASCADE -) +); -- +goose Down --- +goose Up -DROP TABLE token_supply; \ No newline at end of file +DROP TABLE token_supply; diff --git a/db/migrations/00043_create_headers_table.sql b/db/migrations/00043_create_headers_table.sql index 128e4380..22072fdd 100644 --- a/db/migrations/00043_create_headers_table.sql +++ b/db/migrations/00043_create_headers_table.sql @@ -12,5 +12,6 @@ CREATE TABLE public.headers ( ON DELETE CASCADE ); + -- +goose Down -DROP TABLE public.headers; \ No newline at end of file +DROP TABLE public.headers; diff --git a/db/migrations/00044_create_checked_headers_table.sql b/db/migrations/00044_create_checked_headers_table.sql index 23cf6d88..4a7069c3 100644 --- a/db/migrations/00044_create_checked_headers_table.sql +++ b/db/migrations/00044_create_checked_headers_table.sql @@ -6,4 +6,4 @@ CREATE TABLE public.checked_headers ( ); -- +goose Down -DROP TABLE public.checked_headers; \ No newline at end of file +DROP TABLE public.checked_headers; diff --git a/db/migrations/00045_create_maker_schema.sql b/db/migrations/00045_create_maker_schema.sql index b74e05ff..2880a0fe 100644 --- a/db/migrations/00045_create_maker_schema.sql +++ b/db/migrations/00045_create_maker_schema.sql @@ -2,6 +2,5 @@ CREATE SCHEMA maker; - -- +goose Down DROP SCHEMA maker; diff --git a/db/migrations/00046_create_flip_kick.sql b/db/migrations/00046_create_flip_kick.sql index 10b8c0f6..cb5b9d4d 100644 --- a/db/migrations/00046_create_flip_kick.sql +++ b/db/migrations/00046_create_flip_kick.sql @@ -18,8 +18,9 @@ CREATE TABLE maker.flip_kick ( ALTER TABLE public.checked_headers 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 + DROP COLUMN flip_kick_checked; diff --git a/db/migrations/00047_create_frob.sql b/db/migrations/00047_create_frob.sql index 8c13f913..6e1f5e10 100644 --- a/db/migrations/00047_create_frob.sql +++ b/db/migrations/00047_create_frob.sql @@ -18,8 +18,9 @@ CREATE TABLE maker.frob ( ALTER TABLE public.checked_headers 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 + DROP COLUMN frob_checked; diff --git a/db/migrations/00048_create_price_feeds_table.sql b/db/migrations/00048_create_price_feeds_table.sql index cb325048..10ea48f2 100644 --- a/db/migrations/00048_create_price_feeds_table.sql +++ b/db/migrations/00048_create_price_feeds_table.sql @@ -11,5 +11,6 @@ CREATE TABLE maker.price_feeds ( UNIQUE (header_id, medianizer_address, tx_idx, log_idx) ); + -- +goose Down -DROP TABLE maker.price_feeds; \ No newline at end of file +DROP TABLE maker.price_feeds; diff --git a/db/migrations/00049_create_tend.sql b/db/migrations/00049_create_tend.sql index e4d07c2c..85df5505 100644 --- a/db/migrations/00049_create_tend.sql +++ b/db/migrations/00049_create_tend.sql @@ -21,4 +21,4 @@ ALTER TABLE public.checked_headers DROP TABLE maker.tend; ALTER TABLE public.checked_headers - DROP COLUMN tend_checked; \ No newline at end of file + DROP COLUMN tend_checked; diff --git a/db/migrations/00050_create_bite.sql b/db/migrations/00050_create_bite.sql index adc1dab1..cd01c1f1 100644 --- a/db/migrations/00050_create_bite.sql +++ b/db/migrations/00050_create_bite.sql @@ -18,8 +18,9 @@ CREATE TABLE maker.bite ( ALTER TABLE public.checked_headers 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 + DROP COLUMN bite_checked; diff --git a/db/migrations/00052_create_pit_file.sql b/db/migrations/00052_create_pit_file.sql index f7305c4e..712e8792 100644 --- a/db/migrations/00052_create_pit_file.sql +++ b/db/migrations/00052_create_pit_file.sql @@ -42,6 +42,7 @@ ALTER TABLE public.checked_headers ALTER TABLE public.checked_headers 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; @@ -54,4 +55,4 @@ 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 + DROP COLUMN pit_file_stability_fee_checked; diff --git a/db/migrations/00053_create_vat_init.sql b/db/migrations/00053_create_vat_init.sql index a3d59e61..41260840 100644 --- a/db/migrations/00053_create_vat_init.sql +++ b/db/migrations/00053_create_vat_init.sql @@ -12,6 +12,7 @@ CREATE TABLE maker.vat_init ( ALTER TABLE public.checked_headers ADD COLUMN vat_init_checked BOOLEAN NOT NULL DEFAULT FALSE; + -- +goose Down DROP TABLE maker.vat_init; diff --git a/db/migrations/00054_create_drip_file.sql b/db/migrations/00054_create_drip_file.sql index ecf1140d..21716834 100644 --- a/db/migrations/00054_create_drip_file.sql +++ b/db/migrations/00054_create_drip_file.sql @@ -42,6 +42,7 @@ ALTER TABLE public.checked_headers ALTER TABLE public.checked_headers 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; @@ -54,4 +55,4 @@ 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 + DROP COLUMN drip_file_vow_checked; diff --git a/db/migrations/00055_create_deal.sql b/db/migrations/00055_create_deal.sql index 42046693..4d8ec2c4 100644 --- a/db/migrations/00055_create_deal.sql +++ b/db/migrations/00055_create_deal.sql @@ -17,4 +17,4 @@ ALTER TABLE public.checked_headers DROP TABLE maker.deal; ALTER TABLE public.checked_headers - DROP COLUMN deal_checked; \ No newline at end of file + DROP COLUMN deal_checked; diff --git a/db/migrations/00056_add_price_feed_trigger.sql b/db/migrations/00056_add_price_feed_trigger.sql index a55d0bdf..b3bf0d2b 100644 --- a/db/migrations/00056_add_price_feed_trigger.sql +++ b/db/migrations/00056_add_price_feed_trigger.sql @@ -1,4 +1,5 @@ -- +goose Up +-- +goose StatementBegin CREATE OR REPLACE FUNCTION notify_pricefeed() RETURNS trigger AS $$ BEGIN PERFORM pg_notify( @@ -8,6 +9,7 @@ BEGIN RETURN NEW; END; $$ LANGUAGE plpgsql; +-- +goose StatementEnd CREATE TRIGGER notify_pricefeeds AFTER INSERT ON maker.price_feeds diff --git a/db/migrations/00057_create_drip_drip.sql b/db/migrations/00057_create_drip_drip.sql index baefddf0..ee951aa9 100644 --- a/db/migrations/00057_create_drip_drip.sql +++ b/db/migrations/00057_create_drip_drip.sql @@ -12,8 +12,9 @@ CREATE TABLE maker.drip_drip ( ALTER TABLE public.checked_headers 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 + DROP COLUMN drip_drip_checked; diff --git a/db/migrations/00058_create_cat_file.sql b/db/migrations/00058_create_cat_file.sql index e25df996..6b8acd71 100644 --- a/db/migrations/00058_create_cat_file.sql +++ b/db/migrations/00058_create_cat_file.sql @@ -43,6 +43,7 @@ ALTER TABLE public.checked_headers ALTER TABLE public.checked_headers 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; @@ -55,4 +56,4 @@ 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 + DROP COLUMN cat_file_pit_vow_checked; diff --git a/db/migrations/00059_create_flop_kick.sql b/db/migrations/00059_create_flop_kick.sql index a62e3d47..ff46654c 100644 --- a/db/migrations/00059_create_flop_kick.sql +++ b/db/migrations/00059_create_flop_kick.sql @@ -16,7 +16,8 @@ CREATE TABLE maker.flop_kick ( ALTER TABLE public.checked_headers 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 + DROP COLUMN flop_kick_checked; diff --git a/db/migrations/00060_create_vat_move.sql b/db/migrations/00060_create_vat_move.sql index 7aa31a24..4f156233 100644 --- a/db/migrations/00060_create_vat_move.sql +++ b/db/migrations/00060_create_vat_move.sql @@ -18,4 +18,4 @@ ALTER TABLE public.checked_headers -- +goose Down DROP TABLE maker.vat_move; ALTER TABLE public.checked_headers - DROP COLUMN vat_move_checked; \ No newline at end of file + DROP COLUMN vat_move_checked; diff --git a/db/migrations/00063_create_vat_toll.sql b/db/migrations/00063_create_vat_toll.sql index 1e29fbb1..bea6df99 100644 --- a/db/migrations/00063_create_vat_toll.sql +++ b/db/migrations/00063_create_vat_toll.sql @@ -14,7 +14,8 @@ CREATE TABLE maker.vat_toll ( ALTER TABLE public.checked_headers 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 + DROP COLUMN vat_toll_checked; diff --git a/db/migrations/00064_create_vat_tune.sql b/db/migrations/00064_create_vat_tune.sql index 07f625aa..bd8b5d4b 100644 --- a/db/migrations/00064_create_vat_tune.sql +++ b/db/migrations/00064_create_vat_tune.sql @@ -17,7 +17,8 @@ CREATE TABLE maker.vat_tune ( ALTER TABLE public.checked_headers 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 + DROP COLUMN vat_tune_checked; diff --git a/db/migrations/00065_create_vat_grab.sql b/db/migrations/00065_create_vat_grab.sql index 7fa5035d..e940708f 100644 --- a/db/migrations/00065_create_vat_grab.sql +++ b/db/migrations/00065_create_vat_grab.sql @@ -17,7 +17,8 @@ CREATE TABLE maker.vat_grab ( ALTER TABLE public.checked_headers 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 + DROP COLUMN vat_grab_checked; diff --git a/db/migrations/00067_create_vat_slip.sql b/db/migrations/00067_create_vat_slip.sql index a561eb69..5f4a457c 100644 --- a/db/migrations/00067_create_vat_slip.sql +++ b/db/migrations/00067_create_vat_slip.sql @@ -14,7 +14,8 @@ CREATE TABLE maker.vat_slip ( ALTER TABLE public.checked_headers 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 + DROP COLUMN vat_slip_checked; diff --git a/db/migrations/00068_create_vow_flog.sql b/db/migrations/00068_create_vow_flog.sql index c7e316bc..af429cca 100644 --- a/db/migrations/00068_create_vow_flog.sql +++ b/db/migrations/00068_create_vow_flog.sql @@ -12,7 +12,8 @@ CREATE TABLE maker.vow_flog ( ALTER TABLE public.checked_headers 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 + DROP COLUMN vow_flog_checked; diff --git a/db/migrations/00069_create_flap_kick.sql b/db/migrations/00069_create_flap_kick.sql index ab929cfd..71410fe4 100644 --- a/db/migrations/00069_create_flap_kick.sql +++ b/db/migrations/00069_create_flap_kick.sql @@ -16,7 +16,8 @@ CREATE TABLE maker.flap_kick ( ALTER TABLE public.checked_headers 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 + DROP COLUMN flap_kick_checked; diff --git a/db/migrations/00070_drop_pit_file_stability_fee.sql b/db/migrations/00070_drop_pit_file_stability_fee.sql index f5f20d8f..208be543 100644 --- a/db/migrations/00070_drop_pit_file_stability_fee.sql +++ b/db/migrations/00070_drop_pit_file_stability_fee.sql @@ -18,4 +18,4 @@ CREATE TABLE maker.pit_file_stability_fee ( ); 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; From 4c87ef44b814106687153109f8122bafeec5341b Mon Sep 17 00:00:00 2001 From: Edvard Date: Thu, 24 Jan 2019 10:35:52 +0100 Subject: [PATCH 04/10] Apply taka's fix to faulty down migration --- db/migrations/00040_associate_receipts_with_blocks.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/db/migrations/00040_associate_receipts_with_blocks.sql b/db/migrations/00040_associate_receipts_with_blocks.sql index dea130fb..889772ff 100644 --- a/db/migrations/00040_associate_receipts_with_blocks.sql +++ b/db/migrations/00040_associate_receipts_with_blocks.sql @@ -24,6 +24,8 @@ ALTER TABLE receipts 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 From e5f3826633b45359800b1d1f03caa92a80abc071 Mon Sep 17 00:00:00 2001 From: Edvard Date: Thu, 24 Jan 2019 11:54:25 +0100 Subject: [PATCH 05/10] Add Makefile for goose migrations, update README accordingly --- Makefile | 43 +++++++++++++++++++++++++++++++++++-------- README.md | 10 ++++++++-- 2 files changed, 43 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 681f34b3..6a95a558 100644 --- a/Makefile +++ b/Makefile @@ -11,10 +11,10 @@ GINKGO = $(BIN)/ginkgo $(BIN)/ginkgo: go get -u github.com/onsi/ginkgo/ginkgo -MIGRATE = $(BIN)/migrate -$(BIN)/migrate: - go get -u -d github.com/mattes/migrate/cli github.com/lib/pq - go build -tags 'postgres' -o $(BIN)/migrate github.com/mattes/migrate/cli +GOOSE = $(BIN)/goose +$(BIN)/goose: + go get -u -d github.com/pressly/goose/cmd/goose + go build -tags='no_mysql no_sqlite' -o $(BIN)/goose github.com/pressly/goose LINT = $(BIN)/golint $(BIN)/golint: @@ -74,16 +74,43 @@ checkdbvars: @echo $(CONNECT_STRING) +# Goose defaults down migrations to 1 step .PHONY: rollback -rollback: $(MIGRATE) checkdbvars - $(MIGRATE) -database $(CONNECT_STRING) -path ./db/migrations down 1 +rollback: $(GOOSE) checkdbvars + cd db/migrations;\ + $(GOOSE) postgres "$(CONNECT_STRING)" down pg_dump -O -s $(CONNECT_STRING) > db/schema.sql +.PHONY: checkmigration +checkmigration: + test -n "$(MIGRATION)" # $$MIGRATION + +# MIGRATION is either a version integer or a timestamp +.PHONY: rollback_to +rollback_to: $(GOOSE) checkmigration checkdbvars + cd db/migrations;\ + $(GOOSE) postgres "$(CONNECT_STRING)" down-to "$(MIGRATION)" + .PHONY: migrate -migrate: $(MIGRATE) checkdbvars - $(MIGRATE) -database $(CONNECT_STRING) -path ./db/migrations up +migrate: $(GOOSE) checkdbvars + cd db/migrations;\ + $(GOOSE) postgres "$(CONNECT_STRING)" up pg_dump -O -s $(CONNECT_STRING) > db/schema.sql +.PHONY: checkmigname +checkmigname: + test -n "$(NAME)" # $$NAME + +.PHONY: new_migration +new_migration: $(GOOSE) checkmigname + cd db/migrations;\ + $(GOOSE) create $(NAME) sql + +.PHONY: migration_status +migration_status: $(GOOSE) checkdbvars + cd db/migrations;\ + $(GOOSE) postgres "$(CONNECT_STRING)" status + .PHONY: import import: test -n "$(NAME)" # $$NAME diff --git a/README.md b/README.md index 21810a7a..b940a87d 100644 --- a/README.md +++ b/README.md @@ -25,11 +25,17 @@ Vulcanize DB is a set of tools that make it easier for developers to write appli 1. `createdb vulcanize_public` 1. `cd $GOPATH/src/github.com/vulcanize/vulcanizedb` 1. Run the migrations: `make migrate HOST_NAME=localhost NAME=vulcanize_public PORT=5432` + - To rollback a single step: `make rollback NAME=vulcanize_public` + - To rollback to a certain migration: `make rollback_to MIGRATION=n NAME=vulcanize_public` + - To see status of migrations: `make migration_status NAME=vulcanize_public` * See below for configuring additional environments -## Create a migration file (up and down) -1. ./script/create_migrate create_bite_table +## Create a migration file +1. `make new_migration NAME=add_columnA_to_table1` + - This will create a new timestamped migration file in `db/migrations` +1. Write the migration code in the created file, under the respective `goose` pragma + - Goose automatically runs each migration in a transaction; don't add `BEGIN` and `COMMIT` statements. ## Configuration - To use a local Ethereum node, copy `environments/public.toml.example` to From 699dc1143d8d68670087eee64610c08f3fc5dc90 Mon Sep 17 00:00:00 2001 From: Edvard Date: Thu, 24 Jan 2019 11:54:56 +0100 Subject: [PATCH 06/10] Update schema with for goose metatable --- db/schema.sql | 83 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 34 deletions(-) diff --git a/db/schema.sql b/db/schema.sql index 94e5e203..4cc89f01 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -2,8 +2,8 @@ -- PostgreSQL database dump -- --- Dumped from database version 10.3 --- Dumped by pg_dump version 10.5 +-- Dumped from database version 10.5 +-- Dumped by pg_dump version 11.1 SET statement_timeout = 0; SET lock_timeout = 0; @@ -22,20 +22,6 @@ SET row_security = off; CREATE SCHEMA maker; --- --- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: - --- - -CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; - - --- --- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: - --- - -COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; - - -- -- Name: notify_pricefeed(); Type: FUNCTION; Schema: public; Owner: - -- @@ -1227,6 +1213,38 @@ CREATE TABLE public.eth_nodes ( ); +-- +-- Name: goose_db_version; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.goose_db_version ( + id integer NOT NULL, + version_id bigint NOT NULL, + is_applied boolean NOT NULL, + tstamp timestamp without time zone DEFAULT now() +); + + +-- +-- Name: goose_db_version_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.goose_db_version_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: goose_db_version_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.goose_db_version_id_seq OWNED BY public.goose_db_version.id; + + -- -- Name: headers; Type: TABLE; Schema: public; Owner: - -- @@ -1378,16 +1396,6 @@ CREATE SEQUENCE public.receipts_id_seq ALTER SEQUENCE public.receipts_id_seq OWNED BY public.receipts.id; --- --- Name: schema_migrations; Type: TABLE; Schema: public; Owner: - --- - -CREATE TABLE public.schema_migrations ( - version bigint NOT NULL, - dirty boolean NOT NULL -); - - -- -- Name: token_supply; Type: TABLE; Schema: public; Owner: - -- @@ -1729,6 +1737,13 @@ ALTER TABLE ONLY public.checked_headers ALTER COLUMN id SET DEFAULT nextval('pub ALTER TABLE ONLY public.eth_nodes ALTER COLUMN id SET DEFAULT nextval('public.nodes_id_seq'::regclass); +-- +-- Name: goose_db_version id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.goose_db_version ALTER COLUMN id SET DEFAULT nextval('public.goose_db_version_id_seq'::regclass); + + -- -- Name: headers id; Type: DEFAULT; Schema: public; Owner: - -- @@ -2274,6 +2289,14 @@ ALTER TABLE ONLY public.eth_nodes ADD CONSTRAINT eth_node_uc UNIQUE (genesis_block, network_id, eth_node_id); +-- +-- Name: goose_db_version goose_db_version_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.goose_db_version + ADD CONSTRAINT goose_db_version_pkey PRIMARY KEY (id); + + -- -- Name: headers headers_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -2314,14 +2337,6 @@ ALTER TABLE ONLY public.receipts ADD CONSTRAINT receipts_pkey PRIMARY KEY (id); --- --- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: - --- - -ALTER TABLE ONLY public.schema_migrations - ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); - - -- -- Name: transactions transactions_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- From 6b4eb575714467329b37948a3ad8b414017ce516 Mon Sep 17 00:00:00 2001 From: Edvard Date: Thu, 24 Jan 2019 12:03:44 +0100 Subject: [PATCH 07/10] Fix supfile to use goose for migrations --- Makefile | 2 +- Supfile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6a95a558..54e9c695 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ $(BIN)/gometalinter.v2: $(METALINT) --install .PHONY: installtools -installtools: | $(LINT) $(MIGRATE) $(GINKGO) $(DEP) +installtools: | $(LINT) $(GOOSE) $(GINKGO) $(DEP) echo "Installing tools" .PHONY: metalint diff --git a/Supfile b/Supfile index ba558f76..c224ae87 100644 --- a/Supfile +++ b/Supfile @@ -38,7 +38,8 @@ commands: run: > cd $VDB_PATH && make installtools && - /root/go_projects/bin/migrate -database postgresql://$VDB_PG_USER:$VDB_PG_PW@127.0.0.1:5432/vulcanize_public?sslmode=disable -path ./db/migrations up + cd db/migrations && + /root/go_projects/bin/goose postgres "postgresql://$(VDB_PG_USER):$(VDB_PG_PW)@127.0.0.1:5432/vulcanize_public?sslmode=disable" up buildPostgraphile: desc: build postgraphile app run: > From 0c7cfe56090ec89a6e30c46c4757f22acfdd1b8e Mon Sep 17 00:00:00 2001 From: Edvard Date: Thu, 24 Jan 2019 13:17:41 +0100 Subject: [PATCH 08/10] Fix travis and expand makefile targets --- .travis.yml | 3 ++- Makefile | 48 ++++++++++++++++++++++++++++++++++++------------ 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 91f69040..50d93625 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ addons: go_import_path: github.com/vulcanize/vulcanizedb before_install: - # ginkgo golint dep migrate + # ginkgo golint dep goose - make installtools - bash ./scripts/install-postgres-10.sh - npm install -g ganache-cli @@ -23,6 +23,7 @@ before_install: before_script: - go get -u github.com/pressly/sup/cmd/sup - sudo -u postgres createdb vulcanize_private + - make version_migrations - make migrate NAME=vulcanize_private - bash ./pkg/transformers/start_test_chain.sh - cd postgraphile && yarn diff --git a/Makefile b/Makefile index 54e9c695..5146d659 100644 --- a/Makefile +++ b/Makefile @@ -2,29 +2,35 @@ BIN = $(GOPATH)/bin BASE = $(GOPATH)/src/$(PACKAGE) PKGS = go list ./... | grep -v "^vendor/" -#Tools +# Tools +## Dependency management DEP = $(BIN)/dep $(BIN)/dep: go get -u github.com/golang/dep/cmd/dep +## Testing library GINKGO = $(BIN)/ginkgo $(BIN)/ginkgo: go get -u github.com/onsi/ginkgo/ginkgo +## Migration tool GOOSE = $(BIN)/goose $(BIN)/goose: go get -u -d github.com/pressly/goose/cmd/goose go build -tags='no_mysql no_sqlite' -o $(BIN)/goose github.com/pressly/goose +## Source linter LINT = $(BIN)/golint $(BIN)/golint: go get -u golang.org/x/lint/golint +## Combination linter METALINT = $(BIN)/gometalinter.v2 $(BIN)/gometalinter.v2: go get -u gopkg.in/alecthomas/gometalinter.v2 $(METALINT) --install + .PHONY: installtools installtools: | $(LINT) $(GOOSE) $(GINKGO) $(DEP) echo "Installing tools" @@ -66,57 +72,75 @@ PORT = 5432 NAME = CONNECT_STRING=postgresql://$(HOST_NAME):$(PORT)/$(NAME)?sslmode=disable +# Parameter checks +## Check that DB variables are provided .PHONY: checkdbvars checkdbvars: - test -n "$(HOST_NAME)" # $$HOST_NAME + test -n "$(HOST_NAME)" # $$HOST_NAME test -n "$(PORT)" # $$PORT test -n "$(NAME)" # $$NAME @echo $(CONNECT_STRING) +## Check that the migration variable (id/timestamp) is provided +.PHONY: checkmigration +checkmigration: + test -n "$(MIGRATION)" # $$MIGRATION -# Goose defaults down migrations to 1 step +# Check that the migration name is provided +.PHONY: checkmigname +checkmigname: + test -n "$(NAME)" # $$NAME + +# Migration operations +## Rollback the last migration .PHONY: rollback rollback: $(GOOSE) checkdbvars cd db/migrations;\ $(GOOSE) postgres "$(CONNECT_STRING)" down pg_dump -O -s $(CONNECT_STRING) > db/schema.sql -.PHONY: checkmigration -checkmigration: - test -n "$(MIGRATION)" # $$MIGRATION -# MIGRATION is either a version integer or a timestamp +## Rollbackt to a select migration (id/timestamp) .PHONY: rollback_to rollback_to: $(GOOSE) checkmigration checkdbvars cd db/migrations;\ $(GOOSE) postgres "$(CONNECT_STRING)" down-to "$(MIGRATION)" +## Apply all migrations not already run .PHONY: migrate migrate: $(GOOSE) checkdbvars cd db/migrations;\ $(GOOSE) postgres "$(CONNECT_STRING)" up pg_dump -O -s $(CONNECT_STRING) > db/schema.sql -.PHONY: checkmigname -checkmigname: - test -n "$(NAME)" # $$NAME - +## Create a new migration file .PHONY: new_migration new_migration: $(GOOSE) checkmigname cd db/migrations;\ $(GOOSE) create $(NAME) sql +## Check which migrations are applied at the moment .PHONY: migration_status migration_status: $(GOOSE) checkdbvars cd db/migrations;\ $(GOOSE) postgres "$(CONNECT_STRING)" status +# Convert timestamped migrations to versioned (to be run in CI); +# merge timestamped files to prevent conflict +.PHONY: version_migrations +version_migrations: + cd db/migrations;\ + $(GOOSE) fix + +# Import a psql schema to the database .PHONY: import import: test -n "$(NAME)" # $$NAME psql $(NAME) < db/schema.sql -#Rinkeby docker environment + +# Docker actions +## Rinkeby docker environment RINKEBY_COMPOSE_FILE=dockerfiles/rinkeby/docker-compose.yml .PHONY: rinkeby_env_up From e1fd58c9bc16b1f037eb6355f3c7e71224963a72 Mon Sep 17 00:00:00 2001 From: Edvard Date: Thu, 24 Jan 2019 14:28:09 +0100 Subject: [PATCH 09/10] Debug; trigger travis --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5146d659..b98ec40b 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ $(BIN)/ginkgo: GOOSE = $(BIN)/goose $(BIN)/goose: go get -u -d github.com/pressly/goose/cmd/goose - go build -tags='no_mysql no_sqlite' -o $(BIN)/goose github.com/pressly/goose + go build -tags='no_mysql no_sqlite' -o $(BIN)/goose github.com/pressly/goose/cmd/goose ## Source linter LINT = $(BIN)/golint @@ -129,8 +129,7 @@ migration_status: $(GOOSE) checkdbvars # merge timestamped files to prevent conflict .PHONY: version_migrations version_migrations: - cd db/migrations;\ - $(GOOSE) fix + cd db/migrations; $(GOOSE) fix # Import a psql schema to the database .PHONY: import From 09f2984f1e94b7ba716eca68c8a4a4bb13bb3622 Mon Sep 17 00:00:00 2001 From: Edvard Date: Fri, 25 Jan 2019 11:42:21 +0100 Subject: [PATCH 10/10] Delete old migration script --- scripts/create_migration | 9 --------- 1 file changed, 9 deletions(-) delete mode 100755 scripts/create_migration diff --git a/scripts/create_migration b/scripts/create_migration deleted file mode 100755 index 27e4a1bc..00000000 --- a/scripts/create_migration +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -if [ $# -eq 1 ] -then - $GOPATH/bin/migrate create -dir ./db/migrations -ext sql $1 -else - echo "**An Error Occurred**" - echo "Usage: ./scripts/create_migration " -fi