-- Add unique constraint on collaboration_sessions for (project_id, user_id)
-- This ensures a user can only have one active session per project,
-- and allows upsert operations for session management.
ALTER TABLE collaboration_sessions
  ADD CONSTRAINT collaboration_sessions_project_user_unique
  UNIQUE (project_id, user_id);
