- 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>
13 lines
449 B
SQL
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 없음(기본 거부)
|