From d2f9b1241963deea8d17ee123fa85b3d74a78f01 Mon Sep 17 00:00:00 2001 From: Leopoldadmin Date: Tue, 9 Jun 2026 23:31:05 +0000 Subject: [PATCH] Add backend/app/models/attachment.py --- backend/app/models/attachment.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 backend/app/models/attachment.py diff --git a/backend/app/models/attachment.py b/backend/app/models/attachment.py new file mode 100644 index 0000000..199ba85 --- /dev/null +++ b/backend/app/models/attachment.py @@ -0,0 +1,18 @@ +"""Attachment model.""" +from sqlalchemy import Column, Integer, String, ForeignKey, DateTime +from sqlalchemy.orm import relationship +from datetime import datetime +from app.database import Base + +class Attachment(Base): + """Attachment model.""" + __tablename__ = "attachments" + + id = Column(Integer, primary_key=True, index=True) + filename = Column(String(255), nullable=False) + filepath = Column(String(500), nullable=False) + file_size = Column(Integer) + mime_type = Column(String(100)) + record_id = Column(Integer, nullable=True) + uploaded_by = Column(Integer, ForeignKey("users.id"), nullable=False) + created_at = Column(DateTime, default=datetime.utcnow)