managarten/chat/apps/mobile/scripts/add_conversation_title.sql
Till-JS c638a7ffee feat(chat): integrate chat project into monorepo with full app structure
- Restructure chat as apps/mobile, apps/web, apps/landing, backend
- Add NestJS backend for secure Azure OpenAI API calls
- Remove exposed API key from mobile app (security fix)
- Add shared chat-types package
- Create SvelteKit web app scaffold
- Create Astro landing page scaffold
- Update pnpm workspace configuration
- Add project-level CLAUDE.md documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 13:48:24 +01:00

19 lines
No EOL
843 B
SQL

-- SQL zum Hinzufügen der Titel-Spalte zur Conversations-Tabelle
-- SCHRITT 1: Spalte zur Tabelle hinzufügen
ALTER TABLE conversations
ADD COLUMN IF NOT EXISTS title TEXT;
-- SCHRITT 2: Kommentar für Dokumentation hinzufügen
COMMENT ON COLUMN conversations.title IS 'KI-generierter Titel für die Konversation';
-- SCHRITT 3: Aktualisiere RLS-Policy (Row Level Security) für die neue Spalte
-- (Stelle sicher, dass Benutzer nur ihre eigenen Konversationen lesen/bearbeiten können)
DROP POLICY IF EXISTS "Users can update their own conversations" ON conversations;
CREATE POLICY "Users can update their own conversations"
ON conversations
FOR UPDATE USING (user_id = auth.uid());
-- SCHRITT 4: (Optional) Standardwerte für bestehende Konversationen setzen
UPDATE conversations
SET title = 'Frühere Konversation'
WHERE title IS NULL;