FDN-01: repository & projektgerüst
Git-Repository für bestehenden archivdms-Code initialisiert, Branch-/Commit-Konvention (feature/<ticket>-<slug>-Branches, Ticket-Prefix in Commit-Nachricht) etabliert.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
-- PROJ: Freitext-Notizen pro Dokument (Paperless-ngx inspiriert)
|
||||
-- Doku-only (siehe README.md in diesem Verzeichnis) — die tatsächliche
|
||||
-- Ausführung passiert idempotent über
|
||||
-- internal/storage/document_notes.go initDocumentNotesSchema(), aufgerufen aus
|
||||
-- (*Store).initSchema() NACH dem documents-Schema (FK auf documents(id)).
|
||||
--
|
||||
-- Abgrenzung zu Custom-Fields: Custom-Fields sind strukturierte Metadaten;
|
||||
-- eine Notiz ist reiner Freitext-Kommentar mit Autor + Zeitstempel. Notizen
|
||||
-- sind KEINE GoBD-Belege, deshalb hartes DELETE (kein Soft-Delete). Create und
|
||||
-- Delete werden dennoch im Audit-Log protokolliert (Nachvollziehbarkeit).
|
||||
|
||||
CREATE TABLE IF NOT EXISTS document_notes (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
document_id BIGINT NOT NULL REFERENCES documents(id),
|
||||
tenant_id BIGINT NOT NULL,
|
||||
author_id BIGINT NOT NULL,
|
||||
text TEXT NOT NULL,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS idx_document_notes_document ON document_notes (document_id, tenant_id);
|
||||
Reference in New Issue
Block a user