fix: chat — VARCHAR(10) overflow for notifications type, skeleton loading
- Migration 072: widen type column to VARCHAR(20), add partial unique index for general rooms - Backend: replace brittle ON CONFLICT with explicit SELECT-then-INSERT ensureRoom helper - Frontend: show room skeletons (Общий чат + Уведомления) during load instead of spinner, hide '0 чатов' subtitle when list is empty Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
6
backend/migrations/072_chat_room_type_length.sql
Normal file
6
backend/migrations/072_chat_room_type_length.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
-- Increase type column length to fit 'notifications'
|
||||
ALTER TABLE chat_rooms ALTER COLUMN type TYPE VARCHAR(20);
|
||||
|
||||
-- Partial unique index for general room per hotel (needed for ON CONFLICT)
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS uniq_chat_rooms_general_hotel
|
||||
ON chat_rooms(hotel_id) WHERE type = 'general';
|
||||
Reference in New Issue
Block a user