Add backend/app/models/attachment.py
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user