feat: Expandable metadata drawer + transcription system (#175, #176) #178

Merged
marcel merged 47 commits from feat/issue-175-176-metadata-drawer-transcription into main 2026-04-06 11:31:11 +02:00
3 changed files with 29 additions and 0 deletions
Showing only changes of commit 5231476c27 - Show all commits

View File

@@ -0,0 +1,16 @@
CREATE TABLE transcription_blocks (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
annotation_id UUID NOT NULL REFERENCES document_annotations(id) ON DELETE CASCADE,
document_id UUID NOT NULL REFERENCES documents(id) ON DELETE CASCADE,
text TEXT NOT NULL DEFAULT '',
label VARCHAR(200),
sort_order INTEGER NOT NULL DEFAULT 0,
version INTEGER NOT NULL DEFAULT 0,
created_by UUID REFERENCES app_users(id) ON DELETE SET NULL,
updated_by UUID REFERENCES app_users(id) ON DELETE SET NULL,
created_at TIMESTAMP NOT NULL DEFAULT now(),
updated_at TIMESTAMP NOT NULL DEFAULT now()
);
CREATE INDEX idx_tb_document_sort ON transcription_blocks(document_id, sort_order);
CREATE INDEX idx_tb_annotation ON transcription_blocks(annotation_id);

View File

@@ -0,0 +1,9 @@
CREATE TABLE transcription_block_versions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
block_id UUID NOT NULL REFERENCES transcription_blocks(id) ON DELETE CASCADE,
text TEXT NOT NULL,
changed_by UUID REFERENCES app_users(id) ON DELETE SET NULL,
changed_at TIMESTAMP NOT NULL DEFAULT now()
);
CREATE INDEX idx_tbv_block ON transcription_block_versions(block_id, changed_at DESC);

View File

@@ -0,0 +1,4 @@
ALTER TABLE document_comments
ADD COLUMN block_id UUID REFERENCES transcription_blocks(id) ON DELETE CASCADE;
CREATE INDEX idx_dc_block ON document_comments(block_id);