Files
jaengseung-made/supabase/migrations/2026-07-02-phase1-ad-channels.sql
gahusb 3e031a1c80 feat(phase1): ad_channels 테이블 + admin CRUD API
- Migration: ad_channels table (uuid, name, url, status, memo)
- Routes: GET/POST /api/admin/ad-channels (list/create)
- Routes: PATCH/DELETE /api/admin/ad-channels/[id] (update/delete)
- Auth: admin_token verification via verifyAdminTokenNode
- RLS: service_role only, no additional policies

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 15:19:09 +09:00

13 lines
449 B
SQL

CREATE TABLE IF NOT EXISTS ad_channels (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
name text NOT NULL,
url text,
status text NOT NULL DEFAULT 'active' CHECK (status IN ('active','paused')),
memo text,
created_at timestamptz NOT NULL DEFAULT now(),
updated_at timestamptz NOT NULL DEFAULT now()
);
ALTER TABLE ad_channels ENABLE ROW LEVEL SECURITY;
-- service_role(관리자 API)만 접근 — 별도 policy 없음(기본 거부)