mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-18 20:41:23 +02:00
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>
This commit is contained in:
parent
fcf3a344b1
commit
c638a7ffee
155 changed files with 22622 additions and 348 deletions
46
chat/apps/mobile/scripts/fix_messages_constraint.sql
Normal file
46
chat/apps/mobile/scripts/fix_messages_constraint.sql
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
-- SQL-Skript, um die Nachrichtentabelle zu überprüfen und zu korrigieren
|
||||
|
||||
-- Überprüfe die aktuelle Struktur der messages-Tabelle
|
||||
SELECT
|
||||
column_name,
|
||||
data_type,
|
||||
is_nullable,
|
||||
column_default
|
||||
FROM
|
||||
information_schema.columns
|
||||
WHERE
|
||||
table_name = 'messages'
|
||||
ORDER BY
|
||||
ordinal_position;
|
||||
|
||||
-- Überprüfe Constraints für die messages-Tabelle
|
||||
SELECT
|
||||
tc.constraint_name,
|
||||
tc.constraint_type,
|
||||
kcu.column_name,
|
||||
cc.check_clause
|
||||
FROM
|
||||
information_schema.table_constraints tc
|
||||
JOIN
|
||||
information_schema.constraint_column_usage kcu
|
||||
ON tc.constraint_name = kcu.constraint_name
|
||||
LEFT JOIN
|
||||
information_schema.check_constraints cc
|
||||
ON tc.constraint_name = cc.constraint_name
|
||||
WHERE
|
||||
tc.table_name = 'messages';
|
||||
|
||||
-- Behebt das Problem mit der Check-Constraint in der messages-Tabelle
|
||||
-- Entfernt die bestehende Check-Constraint und erstellt eine neue, die 'assistant' akzeptiert
|
||||
DO $$
|
||||
BEGIN
|
||||
-- Entferne die bestehende Check-Constraint
|
||||
ALTER TABLE messages DROP CONSTRAINT IF EXISTS messages_sender_check;
|
||||
|
||||
-- Erstelle eine neue Check-Constraint, die 'assistant' akzeptiert
|
||||
ALTER TABLE messages
|
||||
ADD CONSTRAINT messages_sender_check
|
||||
CHECK (sender IN ('user', 'assistant', 'system'));
|
||||
|
||||
RAISE NOTICE 'Check-Constraint für die sender-Spalte in der messages-Tabelle wurde aktualisiert.';
|
||||
END $$;
|
||||
Loading…
Add table
Add a link
Reference in a new issue