--- channels-no-groups

UPDATE channel_members
SET deleted = TRUE
WHERE is_group = TRUE;

ALTER TABLE channel_members
  DROP COLUMN is_group;

ALTER TABLE channel_members
  DROP COLUMN group_id;

UPDATE channels
SET total_members = (
  SELECT count(*)
  FROM channel_members
  WHERE channel_members.channel_id = channels.id
        AND channel_members.deleted = FALSE);
