Initial commit: svg backend
This commit is contained in:
38
backend/app/models/upload.py
Normal file
38
backend/app/models/upload.py
Normal file
@@ -0,0 +1,38 @@
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import BigInteger, DateTime, Integer, String, Text, func
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from app.db.base import Base
|
||||
|
||||
|
||||
class UploadRecord(Base):
|
||||
__tablename__ = "uploads"
|
||||
|
||||
id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True)
|
||||
upload_id: Mapped[str] = mapped_column(String(32), unique=True, index=True, nullable=False)
|
||||
|
||||
original_filename: Mapped[str] = mapped_column(String(512), nullable=False)
|
||||
content_type: Mapped[str] = mapped_column(String(255), nullable=False)
|
||||
size_bytes: Mapped[int] = mapped_column(BigInteger, nullable=False)
|
||||
|
||||
element_count: Mapped[int] = mapped_column(Integer, nullable=False)
|
||||
removed_elements_count: Mapped[int] = mapped_column(Integer, nullable=False)
|
||||
removed_attributes_count: Mapped[int] = mapped_column(Integer, nullable=False)
|
||||
|
||||
normalized_elements_count: Mapped[int] = mapped_column(Integer, nullable=False)
|
||||
normalized_seats_count: Mapped[int] = mapped_column(Integer, nullable=False)
|
||||
normalized_groups_count: Mapped[int] = mapped_column(Integer, nullable=False)
|
||||
normalized_sectors_count: Mapped[int] = mapped_column(Integer, nullable=False)
|
||||
|
||||
original_storage_path: Mapped[str] = mapped_column(Text, nullable=False)
|
||||
sanitized_storage_path: Mapped[str] = mapped_column(Text, nullable=False)
|
||||
normalized_storage_path: Mapped[str] = mapped_column(Text, nullable=False)
|
||||
|
||||
processing_status: Mapped[str] = mapped_column(String(32), nullable=False, default="completed")
|
||||
|
||||
created_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True),
|
||||
nullable=False,
|
||||
server_default=func.now(),
|
||||
)
|
||||
Reference in New Issue
Block a user