feat: add artist_id to sessions
Merged
AR
5mo ago+42+42+01234567890123456789-0-0-0123456789
Adds an artist_id column on sessions so the chat listing can filter chats by artist via their parent session.
artist_id UUID NULL REFERENCES accounts(id) ON DELETE CASCADE— mirrorsrooms.artist_id(20250310153603_add_artist_id_to_rooms.sql).idx_sessions_artist_idfor direct artist lookups.idx_sessions_account_artist_updated_atfor the sidebar's(account, artist, recency)ordering.
Test plan
- Apply locally; verify the column, FK, and both indexes exist.
- Insert a session with a valid
artist_idand one withNULL; both succeed. - Insert with a non-existent
artist_idUUID; FK violation.
Summary by CodeRabbit
- Chores
- Database structure enhanced to properly associate sessions with specific artists, enabling improved session organization, intuitive artist-based filtering, comprehensive activity tracking, and detailed artist analytics and reporting capabilities.
- Database performance optimized through strategic indexing improvements that accelerate artist session lookups and support efficient filtering operations by account and artist combinations for enhanced user experience.