From 6369835757f2783dc1357afacbf09cfeb8822394 Mon Sep 17 00:00:00 2001 From: Ian Norden Date: Tue, 20 Oct 2020 15:04:21 -0500 Subject: [PATCH] update migrations --- .../00016_remove_deployment_from_tx_cids.sql | 7 ++++++ ...7_state_and_storage_ids_use_big_serial.sql | 25 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 db/migrations/00016_remove_deployment_from_tx_cids.sql create mode 100644 db/migrations/00017_state_and_storage_ids_use_big_serial.sql diff --git a/db/migrations/00016_remove_deployment_from_tx_cids.sql b/db/migrations/00016_remove_deployment_from_tx_cids.sql new file mode 100644 index 00000000..c155b9b0 --- /dev/null +++ b/db/migrations/00016_remove_deployment_from_tx_cids.sql @@ -0,0 +1,7 @@ +-- +goose Up +ALTER TABLE eth.transaction_cids +DROP COLUMN deployment; + +-- +goose Down +ALTER TABLE eth.transaction_cids +ADD COLUMN deployment BOOL NOT NULL DEFAULT FALSE; \ No newline at end of file diff --git a/db/migrations/00017_state_and_storage_ids_use_big_serial.sql b/db/migrations/00017_state_and_storage_ids_use_big_serial.sql new file mode 100644 index 00000000..347484a6 --- /dev/null +++ b/db/migrations/00017_state_and_storage_ids_use_big_serial.sql @@ -0,0 +1,25 @@ +-- +goose Up +ALTER TABLE eth.storage_cids +ALTER COLUMN state_id TYPE BIGINT; + +ALTER TABLE eth.state_accounts +ALTER COLUMN state_id TYPE BIGINT; + +ALTER TABLE eth.state_cids +ALTER COLUMN id TYPE BIGINT; + +ALTER TABLE eth.storage_cids +ALTER COLUMN id TYPE BIGINT; + +-- +goose Down +ALTER TABLE eth.storage_cids +ALTER COLUMN id TYPE INTEGER; + +ALTER TABLE eth.state_cids +ALTER COLUMN id TYPE INTEGER; + +ALTER TABLE eth.state_accounts +ALTER COLUMN state_id TYPE INTEGER; + +ALTER TABLE eth.storage_cids +ALTER COLUMN state_id TYPE INTEGER; \ No newline at end of file