Checking onboardin flow - fix 1

This commit is contained in:
Urtzi Alfaro
2025-07-27 10:01:37 +02:00
parent abad270282
commit cb3ae4d78b
4 changed files with 494 additions and 181 deletions

View File

@@ -9,6 +9,7 @@ from shared.database.base import Base
from datetime import datetime
import uuid
class ModelTrainingLog(Base):
"""
Table to track training job execution and status.
@@ -18,7 +19,7 @@ class ModelTrainingLog(Base):
id = Column(Integer, primary_key=True, index=True)
job_id = Column(String(255), unique=True, index=True, nullable=False)
tenant_id = Column(String(255), index=True, nullable=False)
tenant_id = Column(UUID(as_uuid=True), nullable=False, index=True)
status = Column(String(50), nullable=False, default="pending") # pending, running, completed, failed, cancelled
progress = Column(Integer, default=0) # 0-100 percentage
current_step = Column(String(500), default="")
@@ -44,7 +45,7 @@ class TrainedModel(Base):
id = Column(Integer, primary_key=True, index=True)
model_id = Column(String(255), unique=True, index=True, nullable=False)
tenant_id = Column(String(255), index=True, nullable=False)
tenant_id = Column(UUID(as_uuid=True), nullable=False, index=True)
product_name = Column(String(255), index=True, nullable=False)
# Model information
@@ -75,7 +76,7 @@ class ModelPerformanceMetric(Base):
id = Column(Integer, primary_key=True, index=True)
model_id = Column(String(255), index=True, nullable=False)
tenant_id = Column(String(255), index=True, nullable=False)
tenant_id = Column(UUID(as_uuid=True), nullable=False, index=True)
product_name = Column(String(255), index=True, nullable=False)
# Performance metrics
@@ -106,7 +107,7 @@ class TrainingJobQueue(Base):
id = Column(Integer, primary_key=True, index=True)
job_id = Column(String(255), unique=True, index=True, nullable=False)
tenant_id = Column(String(255), index=True, nullable=False)
tenant_id = Column(UUID(as_uuid=True), nullable=False, index=True)
# Job configuration
job_type = Column(String(50), nullable=False) # full_training, single_product, evaluation
@@ -135,7 +136,7 @@ class ModelArtifact(Base):
id = Column(Integer, primary_key=True, index=True)
model_id = Column(String(255), index=True, nullable=False)
tenant_id = Column(String(255), index=True, nullable=False)
tenant_id = Column(UUID(as_uuid=True), nullable=False, index=True)
# Artifact information
artifact_type = Column(String(50), nullable=False) # model_file, metadata, training_data, etc.