Socrates_docker / characters /cielo /migration_user_state.sql
AlessandroAmodioNGI's picture
feat: Cielo remembers Italian question β€” profile-based triggers, cielo_user_state table
0ebb4d1
Raw
History Blame Contribute Delete
630 Bytes
-- ============================================================
-- Cielo user-state table β€” run once in the Supabase SQL editor
-- Tracks one-time flags per user (e.g. "has Cielo already asked about Italian?")
-- ============================================================
CREATE TABLE IF NOT EXISTS cielo_user_state (
user_id TEXT PRIMARY KEY,
asked_italian BOOLEAN DEFAULT FALSE,
updated_at TIMESTAMPTZ DEFAULT now()
);
ALTER TABLE cielo_user_state ENABLE ROW LEVEL SECURITY;
CREATE POLICY "service_role_all_cielo_state" ON cielo_user_state
FOR ALL TO service_role USING (true) WITH CHECK (true);