Description: (Describe migration here.)
Created: 2020-06-06 03:54:56.188542 UTC
Depends: 2016-10-13_05-36-55_user-event-log
Apply: |
ALTER TABLE users ADD COLUMN default_payment_network text NOT NULL DEFAULT 'btc';
ALTER TABLE users RENAME COLUMN btc_addr TO default_payment_addr;
ALTER TABLE work_events ADD COLUMN credit_to_network text;
UPDATE work_events SET credit_to_network = 'btc'
WHERE credit_to_address IS NOT NULL;
ALTER TABLE event_credit_to_amendments RENAME COLUMN credit_to_btc_addr TO credit_to_address;
ALTER TABLE event_credit_to_amendments ADD COLUMN credit_to_network text;
UPDATE event_credit_to_amendments SET credit_to_network = 'btc'
WHERE credit_to_address IS NOT NULL;
Revert: |
ALTER TABLE event_credit_to_amendments RENAME COLUMN credit_to_address TO credit_to_btc_addr;
ALTER TABLE event_credit_to_amendments DROP COLUMN credit_to_network;
ALTER TABLE work_events DROP COLUMN credit_to_network;
ALTER TABLE users RENAME COLUMN default_payment_addr TO btc_addr;
ALTER TABLE users DROP COLUMN default_payment_network;