-- 182_study_sessions_topic_fk.sql (4/6) -- study_sessions 에 study_topic_id 컬럼 추가 (1:N). -- 기존 세션은 NULL 로 남고, 사용자가 점진적으로 묶음에 연결. -- 주제가 soft-delete 되면 ON DELETE SET NULL 대비 (현재는 soft delete 라 hard delete 발생 시 보호). ALTER TABLE study_sessions ADD COLUMN IF NOT EXISTS study_topic_id BIGINT REFERENCES study_topics(id) ON DELETE SET NULL;