-- Schema Update: public.ak_users 增加真实姓名与手机号字段（用于分销/推广员等管理端展示）
DO $$
BEGIN
  IF NOT EXISTS (
    SELECT 1 FROM information_schema.columns
    WHERE table_schema = 'public' AND table_name = 'ak_users' AND column_name = 'real_name'
  ) THEN
    ALTER TABLE public.ak_users ADD COLUMN real_name text;
    COMMENT ON COLUMN public.ak_users.real_name IS '真实姓名（可选）';
  END IF;

  IF NOT EXISTS (
    SELECT 1 FROM information_schema.columns
    WHERE table_schema = 'public' AND table_name = 'ak_users' AND column_name = 'phone'
  ) THEN
    ALTER TABLE public.ak_users ADD COLUMN phone text;
    COMMENT ON COLUMN public.ak_users.phone IS '手机号（可选）';
  END IF;
END $$;
