ipld-eth-server/db/migrations/00034_update_gas_limit_gas_used.sql
2019-02-26 00:52:54 -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;