-- progress — same shape as the SQLite table it replaces (student_id, scenario_id composite -- key), migrated data-for-data. Postgres is authoritative for this after migration runs. CREATE TABLE IF NOT EXISTS progress ( student_id TEXT NOT NULL REFERENCES students(student_id), scenario_id TEXT NOT NULL, status TEXT, attempts INTEGER DEFAULT 0, last_validated TIMESTAMPTZ, completed_at TIMESTAMPTZ, started_at TIMESTAMPTZ, notes TEXT, time_spent_seconds INTEGER DEFAULT 0, PRIMARY KEY (student_id, scenario_id) ); CREATE INDEX IF NOT EXISTS idx_progress_student ON progress(student_id); CREATE INDEX IF NOT EXISTS idx_progress_status ON progress(status);