Files
Portfolio/supabase/migrations
damjan_savicandClaude Opus 4.5 f8fbac8ac6 auto-claude: subtask-4-4 - Create chat_sessions and chat_messages tables in Supabase
Create SQL migration for chatbot database tables:
- chat_sessions: Stores visitor session data with visitor_id, metadata, timestamps
- chat_messages: Stores chat messages with role (user/assistant/system), content
- Proper indexes for visitor lookup and message ordering
- Row Level Security (RLS) enabled with policies for:
  - Service role full access (for server-side API)
  - Visitor-based access via x-visitor-id header (for potential future client-side)
- Trigger for automatic updated_at column on chat_sessions

Also updated ChatSession interface in chat.ts to include updated_at field.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 00:53:55 +01:00
..