--------------------------------------------------
-- Jun. 18, 2021
-- Author: Tony Chen 
-- Add a new column 'PHOENIX_SYNC_REQUIRED' column to 
-- better track status of syncing user accounts with Phoenix.
--------------------------------------------------

-- Add a new column 'PHOENIX_SYNC_REQUIRED'
ALTER TABLE `users` 
    ADD COLUMN `PHOENIX_SYNC_REQUIRED` VARCHAR(1) NULL DEFAULT 'N' 
;
-- --------------------------------------------------

UPDATE `users` SET 
    `PHOENIX_SYNC_REQUIRED` = 'N'
WHERE 
    `PHOENIX_SYNC_REQUIRED` IS NULL
;
-- --------------------------------------------------

INSERT INTO `version` (`VERSION`, `LAST_MODIFIED_TIME`) VALUES 
    ('2021-06-18', NOW())
;
-- --------------------------------------------------
