ALTER TABLE rsvp_requests ADD COLUMN music_session_id VARCHAR(64) REFERENCES music_sessions(id);
ALTER TABLE rsvp_requests ADD COLUMN chosen boolean DEFAULT FALSE NOT NULL;

--UPDATE rsvp_requests set CHOSEN = TRUE, music_session_id = b.music_session_id FROM (SELECT music_sessions.id as music_session_id, rsvp_requests.id as rsvp_request_id FROM music_sessions JOIN rsvp_slots ON music_sessions.id = rsvp_slots.music_session_id JOIN rsvp_requests_rsvp_slots ON rsvp_requests_rsvp_slots.rsvp_slot_id = rsvp_slots.id JOIN rsvp_requests ON rsvp_requests.id = rsvp_requests_rsvp_slots.rsvp_request_id WHERE rsvp_requests_rsvp_slots.chosen  = TRUE ) b WHERE rsvp_requests.id = rsvp_request_id;

ALTER TABLE music_sessions ADD COLUMN friends_can_join boolean DEFAULT FALSE NOT NULL;
CREATE INDEX rsvp_request_music_session_id ON rsvp_requests USING btree (music_session_id);