-- 添加已草稿和已回复状态到 emails 表
-- draft_replied: 已生成回复草稿
-- replied: 已发送回复

ALTER TABLE emails DROP CONSTRAINT IF EXISTS emails_status_check;

ALTER TABLE emails ADD CONSTRAINT emails_status_check
  CHECK (status IN (
    'draft',
    'sending',
    'sent',
    'delivered',
    'read',
    'failed',
    'draft_replied',
    'replied'
  ));
