File size: 905 Bytes
96e0a31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
-- ============================================================
-- Cielo — Coordinator character Supabase setup
-- Run this once in the Supabase SQL editor
-- ============================================================

-- Recommendations table: stores every character suggestion Cielo made
CREATE TABLE IF NOT EXISTS cielo_recommendations (
    id                    UUID DEFAULT gen_random_uuid() PRIMARY KEY,
    user_id               TEXT NOT NULL,
    user_message          TEXT,
    recommended_character TEXT NOT NULL,
    reason                TEXT,
    created_at            TIMESTAMPTZ DEFAULT now()
);

CREATE INDEX IF NOT EXISTS idx_cielo_recommendations_user_id
    ON cielo_recommendations (user_id);

ALTER TABLE cielo_recommendations ENABLE ROW LEVEL SECURITY;

CREATE POLICY "service_role_all_cielo" ON cielo_recommendations
    FOR ALL TO service_role USING (true) WITH CHECK (true);