infoalloggi-monorepo/apps/db/migrations/47_messages.up.sql
Marco Pedone 98463da038 feat(chat): refactor chat components to use ChatProvider for context management
- Updated ChatTopbar and Chat components to utilize ChatProvider for managing chat state and user information.
- Removed unnecessary props from ChatTopbar and adjusted its implementation to fetch data from context.
- Added ChatProvider to encapsulate chat-related state and functionality.
- Enhanced message handling by introducing reply and forward features in the chat schema and API.
- Cleaned up unused components and optimized imports across chat-related files.
- Improved user avatar color generation logic and removed hardcoded color values.
- Updated loading states and error handling in admin chat management pages.
2026-04-27 16:52:32 +02:00

12 lines
No EOL
386 B
SQL

-- Migration: 47_messages.up.sql
UPDATE public.messages
SET message = ''
WHERE message IS NULL;
ALTER TABLE IF EXISTS public.messages
ALTER COLUMN IF EXISTS message SET NOT NULL;
ALTER TABLE IF EXISTS public.messages
ADD COLUMN IF NOT EXISTS reply_to_id UUID REFERENCES messages(messageid) ON DELETE SET NULL,
ADD COLUMN IF NOT EXISTS is_forwarded BOOLEAN NOT NULL DEFAULT FALSE;