--- add-facebook-channel-type

ALTER TABLE channels ADD facebook_app_id VARCHAR;
ALTER TABLE channels ADD facebook_app_secret VARCHAR;
ALTER TABLE channels ADD facebook_page_token VARCHAR;
ALTER TABLE channels ADD facebook_page_id VARCHAR;

CREATE UNIQUE INDEX channels_facebook_page_token_uniq ON channels(facebook_page_token)
  WHERE deleted = false AND facebook_page_token is NOT NULL;

CREATE UNIQUE INDEX channels_facebook_page_id_uniq ON channels(facebook_page_id)
  WHERE deleted = false AND facebook_page_id is NOT NULL;