-- 将 emails 表的 id 从 bigint identity 改为 UUID

-- 1. 删除旧主键约束
ALTER TABLE public.emails DROP CONSTRAINT IF EXISTS emails_pkey;

-- 2. 删除旧 id 列
ALTER TABLE public.emails DROP COLUMN IF EXISTS id;

-- 3. 添加 UUID id 列
ALTER TABLE public.emails ADD COLUMN id UUID DEFAULT gen_random_uuid() NOT NULL;

-- 4. 设置新主键
ALTER TABLE public.emails ADD CONSTRAINT emails_pkey PRIMARY KEY (id);
