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>
This commit is contained in:
2026-07-02 15:19:09 +09:00
parent 90be0d6316
commit 3e031a1c80
3 changed files with 109 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
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 없음(기본 거부)