from datetime import datetime
from sqlalchemy import Column, Integer, String, Float, DateTime, Boolean, Text
from app.core.database import Base


class MLModelVersion(Base):
    __tablename__ = "ml_model_version"

    id = Column(Integer, primary_key=True, index=True)
    name = Column(String(100), nullable=False)
    model_path = Column(String(500), nullable=False)      # joblib dump path
    vectorizer_path = Column(String(500), nullable=False) # tfidf vectorizer path
    accuracy = Column(Float, default=0.0)
    train_samples = Column(Integer, default=0)
    train_date = Column(DateTime, default=datetime.utcnow)
    is_active = Column(Boolean, default=False)
    description = Column(Text)
    created_at = Column(DateTime, default=datetime.utcnow)
