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

Method migrateDedupStatus

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

Source from the content-addressed store, hash-verified

626 }
627
628 private migrateDedupStatus(): void {
629 const cols = this.db.prepare("PRAGMA table_info(chunks)").all() as Array<{ name: string }>;
630 if (!cols.some((c) => c.name === "dedup_status")) {
631 this.db.exec("ALTER TABLE chunks ADD COLUMN dedup_status TEXT NOT NULL DEFAULT 'active'");
632 this.db.exec("ALTER TABLE chunks ADD COLUMN dedup_target TEXT DEFAULT NULL");
633 this.db.exec("ALTER TABLE chunks ADD COLUMN dedup_reason TEXT DEFAULT NULL");
634 this.db.exec("CREATE INDEX IF NOT EXISTS idx_chunks_dedup_status ON chunks(dedup_status)");
635 this.log.info("Migrated: added dedup_status/dedup_target/dedup_reason columns to chunks");
636 }
637 }
638
639 recordApiLog(toolName: string, input: unknown, output: string, durationMs: number, success: boolean): void {
640 const inputStr = typeof input === "string" ? input : JSON.stringify(input ?? {});

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