gigafibre-fsm/apps/website/supabase/migrations/20260211165931_8057d1e9-4edb-4add-aa91-5e898cbac5d9.sql
louispaulb 6620652900 merge: import site-web-targo into apps/website/ (4 commits preserved)
Integrates www.gigafibre.ca (React/Vite) into the monorepo.
Full git history accessible via `git log -- apps/website/`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 08:09:15 -04:00

29 lines
758 B
SQL

-- Table to log address searches
CREATE TABLE public.search_logs (
id UUID NOT NULL DEFAULT gen_random_uuid() PRIMARY KEY,
search_term TEXT NOT NULL,
selected_address_id TEXT,
selected_address_formatted TEXT,
fiber_available BOOLEAN,
max_speed INTEGER,
contact_email TEXT,
contact_phone TEXT,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()
);
-- Enable RLS
ALTER TABLE public.search_logs ENABLE ROW LEVEL SECURITY;
-- Allow anonymous inserts (public facing feature, no auth required)
CREATE POLICY "Anyone can insert search logs"
ON public.search_logs
FOR INSERT
WITH CHECK (true);
-- Only backend/admin can read logs
CREATE POLICY "No public read on search logs"
ON public.search_logs
FOR SELECT
USING (false);