from enums.file_type import FileType
from enums.type_enum import TypeEnum
from sqlalchemy import Column, Integer, String, Enum, Double
from sqlalchemy.orm import relationship
from db.base import Base


class Entry(Base):
    __tablename__ = "entries"

    id = Column(Integer, primary_key=True, index=True, )
    filename = Column(String(255), nullable=False)
    filename_actual = Column(String(255))
    md5 = Column(String(255), nullable=False)
    sha1 = Column(String(255), nullable=False)
    sha256 = Column(String(255), nullable=False, unique=True)
    file_type = Column(Enum(FileType), nullable=False)
    entropy = Column(Double(), nullable=False)
    malicious = Column(Enum(TypeEnum), nullable=False, name="type")
