-- Jalankan script ini di SQL Editor Supabase Tuan
-- 1. Buat Tabel
create table if not exists "public"."YanzzNime" (
    id text primary key,          -- ID dari AnimeIn (misal: "5948")
    title text,                   -- Judul Anime
    poster text,                  -- URL Poster
    info jsonb,                   -- Info lengkap (Synopsis, Genre, Status, Stream Links)
    created_at timestamp with time zone default timezone('utc'::text, now())
);

-- 2. Aktifkan RLS (Opsional tapi disarankan)
alter table "public"."YanzzNime" enable row level security;

-- 3. Kebijakan INSERT/UPDATE (PENTING AGAR SCRIPT BISA TULIS DATA)
-- Karena Tuan pakai Anon Key, kita buka akses insert/update untuk public (anon)
create policy "Enable insert for everyone" on "public"."YanzzNime"
for insert with check (true);

create policy "Enable update for everyone" on "public"."YanzzNime"
for update using (true);

create policy "Enable select for everyone" on "public"."YanzzNime"
for select using (true);
