ipld-eth-server/db/migrations/20180202032433_update_gas_limit_gas_used.sql
Rob Mulholand 925b1b0b1c Revert "Convert existing migrations from timestamp to versioned"
- This reverts commit 4e2536bf421fd9d2c9067d81f30e0f45c6b94fe7.
- Restore timestamped migrations so goose fix can handle ordering
  dynamically with plugins also supplying timestamp based migrations
2019-02-20 16:01:35 -06:00

33 lines
1.0 KiB
SQL

-- +goose Up
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;
-- +goose Down
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;