ALTER TABLE lesson_sessions ADD COLUMN user_id VARCHAR(64) REFERENCES users(id);
UPDATE lesson_sessions SET user_id = (select user_id from music_sessions where lesson_sessions.id = music_sessions.lesson_session_id) where user_id is NULL;
ALTER TABLE lesson_sessions ALTER COLUMN user_id SET NOT NULL;
CREATE INDEX msuh_client_id ON music_sessions_user_history USING btree (client_id);