status-go/protocol/migrations/sqlite/1674210659_add_contact_requ...

20 lines
691 B
MySQL
Raw Permalink Normal View History

2023-01-20 14:28:30 +00:00
ALTER TABLE contacts ADD COLUMN contact_request_local_clock INT;
ALTER TABLE contacts ADD COLUMN contact_request_remote_clock INT;
ALTER TABLE contacts ADD COLUMN contact_request_remote_state INT;
2023-02-01 17:29:09 +00:00
-- Broken migration, leaving for posterity and eternal embarrassment
-- but hey, on the bright side, this is valid sql
2023-01-20 14:28:30 +00:00
UPDATE contacts SET contact_request_state = CASE
WHEN added THEN
contact_request_state = 2
END;
UPDATE contacts SET contact_request_local_clock = last_updated_locally;
2023-02-01 17:29:09 +00:00
-- Broken migration, leaving for posterity and eternal embarrassment
2023-01-20 14:28:30 +00:00
UPDATE contacts SET contact_request_remote_state = CASE
WHEN has_added_us THEN
contact_request_state = 3
END;