2df7b24ac9
asyncpg prepared statement 는 single-command 만 허용. 원래 한 파일이던 study_sessions 스키마(CREATE TABLE x2 + CREATE INDEX x8)를 143~146 분할 패턴 따라 10개로 분리. 164: CREATE TABLE study_sessions 165~169: study_sessions 인덱스 5개 (partial) 170: CREATE TABLE study_session_assets 171~173: study_session_assets 인덱스 3개 문제: cannot insert multiple commands into a prepared statement 원인: _run_migrations 가 conn.exec_driver_sql 로 단일 prepared statement 실행
7 lines
256 B
SQL
7 lines
256 B
SQL
-- 169_study_sessions_idx_quiz.sql (6/10)
|
|
-- 퀴즈 통계 (Phase 4) — last_quiz_at 가 있는 행만
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_study_sessions_quiz_stats
|
|
ON study_sessions (user_id, study_type, last_quiz_at)
|
|
WHERE last_quiz_at IS NOT NULL;
|