from sqlalchemy.orm import relationship
from archivingsystem.database import Base
from sqlalchemy import Column, String, Integer, BLOB, DateTime, ForeignKey

class FilePackage(Base):
    __tablename__ = "FilePackages"

    PackageID = Column(Integer, autoincrement=True, primary_key=True)
    ArchivedFileID = Column(Integer, ForeignKey("ArchivedFiles.FileID"))
    TimeStampingAuthority = Column(String(255))
    IssuingDate = Column(DateTime)
    TsaCert = Column(BLOB)
    PackageHashSha512 = Column(BLOB)
    ArchivedFile = relationship("ArchivedFile", backref="FilePackages")