feat(akte): FILE-009 Freitext-Notizen an beliebiger Ressource
Polymorphes akte_notiz-Modell (gleiches entitaet_typ/entitaet_id-Muster wie Dokument/Historie/Mangel), CRUD-Endpunkte, NotizenPanel im Akte-Grid. Löschen nur durch Autor oder Administrator. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CVgbozhYmuEhiEJHffRXCV
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
"""FILE-009: Freitext-Notizen in der Akte.
|
||||
|
||||
Revision ID: 0035_akte_notiz
|
||||
Revises: 0034_person
|
||||
Create Date: 2026-09-10
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
|
||||
revision: str = "0035_akte_notiz"
|
||||
down_revision: Union[str, None] = "0034_person"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
op.execute(
|
||||
"""
|
||||
CREATE TABLE akte_notiz (
|
||||
id UUID PRIMARY KEY,
|
||||
entitaet_typ TEXT NOT NULL,
|
||||
entitaet_id TEXT NOT NULL,
|
||||
text TEXT NOT NULL,
|
||||
autor_id INTEGER NOT NULL REFERENCES benutzer(id),
|
||||
erstellt_am TIMESTAMPTZ NOT NULL
|
||||
)
|
||||
"""
|
||||
)
|
||||
op.execute("CREATE INDEX ix_akte_notiz_entitaet ON akte_notiz (entitaet_typ, entitaet_id)")
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.execute("DROP TABLE akte_notiz")
|
||||
Reference in New Issue
Block a user