phase-8: polish, global search, audit log, packaging, and demo docs
This commit is contained in:
@@ -10,8 +10,8 @@ class Attachment(Base):
|
||||
__tablename__ = "attachments"
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||
entity_type: Mapped[str] = mapped_column(String(60), nullable=False)
|
||||
entity_id: Mapped[int] = mapped_column(Integer, nullable=False)
|
||||
entity_type: Mapped[str] = mapped_column(String(60), index=True, nullable=False)
|
||||
entity_id: Mapped[int] = mapped_column(Integer, index=True, nullable=False)
|
||||
original_name: Mapped[str] = mapped_column(String(255), nullable=False)
|
||||
stored_name: Mapped[str] = mapped_column(String(255), nullable=False)
|
||||
mime_type: Mapped[str] = mapped_column(String(120), nullable=False)
|
||||
@@ -24,7 +24,7 @@ class Notification(Base):
|
||||
__tablename__ = "notifications"
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||
type: Mapped[str] = mapped_column(String(60), nullable=False)
|
||||
type: Mapped[str] = mapped_column(String(60), index=True, nullable=False)
|
||||
severity: Mapped[str] = mapped_column(String(20), nullable=False)
|
||||
title: Mapped[str] = mapped_column(String(200), nullable=False)
|
||||
message: Mapped[str] = mapped_column(Text, nullable=False)
|
||||
@@ -34,7 +34,7 @@ class Notification(Base):
|
||||
target_role: Mapped[Optional[str]] = mapped_column(String(50), nullable=True)
|
||||
target_user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("users.id"), nullable=True)
|
||||
dedupe_key: Mapped[str] = mapped_column(String(200), unique=True, nullable=False)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utc_now, nullable=False)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utc_now, index=True, nullable=False)
|
||||
|
||||
|
||||
class NotificationRead(Base):
|
||||
@@ -53,9 +53,9 @@ class AuditLog(Base):
|
||||
__tablename__ = "audit_logs"
|
||||
|
||||
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||
entity_type: Mapped[str] = mapped_column(String(60), nullable=False)
|
||||
entity_id: Mapped[int] = mapped_column(Integer, nullable=False)
|
||||
entity_type: Mapped[str] = mapped_column(String(60), index=True, nullable=False)
|
||||
entity_id: Mapped[int] = mapped_column(Integer, index=True, nullable=False)
|
||||
action: Mapped[str] = mapped_column(String(50), nullable=False)
|
||||
changes_json: Mapped[str] = mapped_column(Text, nullable=False)
|
||||
by_user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("users.id"), nullable=True)
|
||||
at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utc_now, nullable=False)
|
||||
by_user_id: Mapped[Optional[int]] = mapped_column(ForeignKey("users.id"), index=True, nullable=True)
|
||||
at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utc_now, index=True, nullable=False)
|
||||
|
||||
Reference in New Issue
Block a user