| 473 | } |
| 474 | |
| 475 | private migrateTaskId(): void { |
| 476 | const cols = this.db.prepare("PRAGMA table_info(chunks)").all() as Array<{ name: string }>; |
| 477 | if (!cols.some((c) => c.name === "task_id")) { |
| 478 | this.db.exec("ALTER TABLE chunks ADD COLUMN task_id TEXT REFERENCES tasks(id)"); |
| 479 | this.db.exec("CREATE INDEX IF NOT EXISTS idx_chunks_task ON chunks(task_id)"); |
| 480 | this.log.info("Migrated: added task_id column to chunks"); |
| 481 | } |
| 482 | } |
| 483 | |
| 484 | private migrateContentHash(): void { |
| 485 | const cols = this.db.prepare("PRAGMA table_info(chunks)").all() as Array<{ name: string }>; |