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:
2026-04-14 12:03:35 +03:00
parent 3c4c40da44
commit d0dbf33701
3 changed files with 44 additions and 32 deletions

View 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';