feat(migrate): CLI dispatch + verify
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
10
migrate/verify.js
Normal file
10
migrate/verify.js
Normal file
@@ -0,0 +1,10 @@
|
||||
import { pool } from '../lib/db/pool.js';
|
||||
|
||||
// Per-source/type migrated counts (from migration_map) + Karakeep refs (which use
|
||||
// upsertByExternal, not migration_map). Used to audit completeness before cutover.
|
||||
export async function verify() {
|
||||
const { rows: map } = await pool.query(
|
||||
`SELECT source, entity_type, count(*)::int n FROM migration_map GROUP BY source, entity_type ORDER BY source, entity_type`);
|
||||
const { rows: [{ n: bookmarks }] } = await pool.query(`SELECT count(*)::int n FROM refs WHERE source_kind='karakeep'`);
|
||||
return { map, bookmarks };
|
||||
}
|
||||
Reference in New Issue
Block a user