FEAT: Integrated Document Engine with WebP optimization, Thumbnail generation and Hybrid (NAS/SSD) storage logic
This commit is contained in:
BIN
backend/app/models/__pycache__/document.cpython-312.pyc
Normal file
BIN
backend/app/models/__pycache__/document.cpython-312.pyc
Normal file
Binary file not shown.
26
backend/app/models/document.py
Normal file
26
backend/app/models/document.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from sqlalchemy import Column, String, Integer, Boolean, DateTime, ForeignKey
|
||||
from sqlalchemy.dialects.postgresql import UUID
|
||||
from sqlalchemy.sql import func
|
||||
import uuid
|
||||
from app.db.base import Base
|
||||
|
||||
class Document(Base):
|
||||
__tablename__ = "documents"
|
||||
__table_args__ = {"schema": "data"}
|
||||
|
||||
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
parent_type = Column(String(20), nullable=False) # 'organization' vagy 'asset'
|
||||
parent_id = Column(String(50), nullable=False) # Org vagy Asset technikai ID-ja
|
||||
doc_type = Column(String(50)) # pl. 'foundation_deed', 'registration'
|
||||
|
||||
original_name = Column(String(255), nullable=False)
|
||||
file_hash = Column(String(64), nullable=False) # A NAS-on tárolt név (UUID)
|
||||
file_ext = Column(String(10), default="webp")
|
||||
mime_type = Column(String(100), default="image/webp")
|
||||
file_size = Column(Integer)
|
||||
|
||||
has_thumbnail = Column(Boolean, default=False)
|
||||
thumbnail_path = Column(String(255)) # SSD-n lévő elérés
|
||||
|
||||
uploaded_by = Column(Integer, ForeignKey("data.users.id"), nullable=True)
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
Reference in New Issue
Block a user