MCPcopy Create free account
hub / github.com/MemTensor/MemOS / migrateTaskId

Method migrateTaskId

packages/memos-core/src/storage/sqlite.ts:475–482  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 }>;

Callers 1

migrateMethod · 0.95

Calls 4

allMethod · 0.80
prepareMethod · 0.80
execMethod · 0.80
infoMethod · 0.65

Tested by

no test coverage detected