o2o-infinith-demo/supabase/migrations/20260831_discovery_leads.sql
Haewon Kam 3ba8fc839d feat: /discovery CTA 'URL 입력으로 시작하기' — URL 입력 진단 신청 모달 + discovery_leads 저장
- 히어로·하단 CTA 버튼명 변경(무료 AEO/GEO 진단 받기 → URL 입력으로 시작하기), mailto 직행 제거
- DiscoveryLeadModal: URL(필수)·연락처(필수)·상호(선택) → Supabase discovery_leads insert
- RLS anon insert 전용(조회 불가), 저장 실패 시 o2oteam@o2o.kr mailto 폴백 (정직성 규약)
- 마이그레이션 20260831_discovery_leads.sql (적용은 supabase login 후 db push 필요)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgWoJZAvvzMxTpWeenZSia
2026-08-31 16:58:38 +09:00

25 lines
948 B
SQL

-- AI Discovery 랜딩 "URL 입력으로 시작하기" 신청 저장 테이블
-- 익명(anon) 방문자가 insert만 할 수 있고, 읽기·수정·삭제는 service_role 전용.
create table if not exists public.discovery_leads (
id uuid primary key default gen_random_uuid(),
url text not null,
clinic_name text,
contact text not null,
source text not null default 'discovery_landing',
status text not null default 'new', -- new | contacted | audited | closed
created_at timestamptz not null default now()
);
alter table public.discovery_leads enable row level security;
-- 방문자 신청: insert만 허용 (select 정책이 없으므로 anon은 조회 불가)
create policy "anon can insert discovery leads"
on public.discovery_leads
for insert
to anon
with check (true);
comment on table public.discovery_leads is
'AI Discovery 랜딩 진단 신청. /discovery CTA(URL 입력으로 시작하기)에서 저장.';