-- ============================================================
-- 07_create_asmaul_husna.sql
-- Tabel 99 nama Allah (Asmaul Husna)
-- Sumber: Muslim API (/v1/quran/asma)
-- ============================================================

CREATE TABLE IF NOT EXISTS asmaul_husna (
    id              SERIAL PRIMARY KEY,
    number          INTEGER UNIQUE NOT NULL,     -- 1-99
    arabic          TEXT NOT NULL,                -- الرَّحْمـٰنُ
    latin           TEXT NOT NULL,                -- Ar-Rahmanu
    translation     TEXT NOT NULL,                -- Yang Maha Pengasih
    created_at      TIMESTAMPTZ DEFAULT NOW()
);

-- RLS: semua boleh baca
ALTER TABLE asmaul_husna ENABLE ROW LEVEL SECURITY;

CREATE POLICY "asmaul_husna_read_all" ON asmaul_husna
    FOR SELECT USING (true);
