Files
hyungi_document_server/migrations/166_study_sessions_idx_cert.sql
T
Hyungi Ahn 2df7b24ac9 fix(study): split migration 164 into 10 single-statement files (asyncpg)
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 실행
2026-04-27 08:18:40 +09:00

7 lines
257 B
SQL

-- 166_study_sessions_idx_cert.sql (3/10)
-- 자격증 카드 그룹 (Phase 3 모바일 암기노트)
CREATE INDEX IF NOT EXISTS idx_study_sessions_cert
ON study_sessions (user_id, certification, subject, topic)
WHERE study_type = 'certification';