ALTER TABLE IF EXISTS "channels" RENAME TO "quarantine_channels"; -- Make the quarantine channels table hold more generic channel info ALTER TABLE IF EXISTS "quarantine_channels" RENAME COLUMN "channel_id" TO "qc_channel_id"; -- Channels with this flag should retain old qc behaviour ALTER TABLE IF EXISTS "quarantine_channels" DROP COLUMN "is_quarantine_channel"; -- Setting flag to false allows channels to be excluded from XP even if not QC (though QC channels via the above flag imply this flag too) ALTER TABLE IF EXISTS "quarantine_channels" DROP COLUMN "is_valid_for_xp"; -- Ensure that the role ID can be null for non-qc channels ALTER TABLE IF EXISTS "quarantine_channels" ALTER COLUMN "qc_role_id" SET NOT NULL;