feat(migrate): migration_map idempotency ledger

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
root
2026-06-04 22:18:05 +10:00
parent bbb90c12c6
commit 681b091e4a
3 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
-- 018_migration_map.sql — idempotency ledger for void-migrate. Maps a source row
-- to the Void 2 entity it created, so re-running an import never duplicates.
CREATE TABLE migration_map (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
source text NOT NULL, -- 'void1' | 'bookstack' | 'karakeep' | 'plans'
source_id text NOT NULL, -- e.g. 'wiki_pages:42'
entity_type text NOT NULL, -- 'page' | 'project' | 'task' | 'conversation' | 'message'
entity_id uuid NOT NULL,
created_at timestamptz NOT NULL DEFAULT now(),
UNIQUE (source, source_id, entity_type)
);