@@ -19,14 +19,28 @@ class TrialStatus(enum.Enum):
1919COMPLETED_STATUS = [TrialStatus .FINISHED , TrialStatus .FAILED ]
2020
2121
22+ class Project (Base ):
23+ __tablename__ = "projects"
24+
25+ uuid = Column (UUID (as_uuid = True ), primary_key = True , default = uuid .uuid4 )
26+ name = Column (String , nullable = False )
27+ description = Column (String , nullable = True )
28+
29+ created_at = Column (DateTime (timezone = True ), default = datetime .now (UTC ))
30+ updated_at = Column (
31+ DateTime (timezone = True ), default = datetime .now (UTC ), onupdate = datetime .now (UTC )
32+ )
33+ is_del = Column (Integer , default = 0 , comment = "0 for not deleted, 1 for deleted" )
34+
35+
2236# Define the Experiment model for SQLAlchemy
2337class Experiment (Base ):
2438 __tablename__ = "experiments"
2539
2640 uuid = Column (UUID (as_uuid = True ), primary_key = True , default = uuid .uuid4 )
2741 name = Column (String , nullable = False )
2842 description = Column (String , nullable = True )
29- project_id = Column (String , nullable = False )
43+ project_id = Column (UUID ( as_uuid = True ) , nullable = False )
3044 meta = Column (JSON , nullable = True , comment = "Additional metadata for the experiment" )
3145
3246 created_at = Column (DateTime (timezone = True ), default = datetime .now (UTC ))
@@ -40,6 +54,7 @@ class Trial(Base):
4054 __tablename__ = "trials"
4155
4256 uuid = Column (UUID (as_uuid = True ), primary_key = True , default = uuid .uuid4 )
57+ project_id = Column (UUID (as_uuid = True ), nullable = False )
4358 experiment_id = Column (UUID (as_uuid = True ), nullable = False )
4459 name = Column (String , nullable = False )
4560 description = Column (String , nullable = True )
@@ -63,8 +78,8 @@ class Run(Base):
6378 __tablename__ = "runs"
6479
6580 uuid = Column (UUID (as_uuid = True ), primary_key = True , default = uuid .uuid4 )
81+ project_id = Column (UUID (as_uuid = True ), nullable = False )
6682 trial_id = Column (UUID (as_uuid = True ), nullable = False )
67- # artifact_path = Column(String, nullable=False)
6883
6984 created_at = Column (DateTime (timezone = True ), default = datetime .now (UTC ))
7085 updated_at = Column (
@@ -77,10 +92,10 @@ class Model(Base):
7792
7893 uuid = Column (UUID (as_uuid = True ), primary_key = True , default = uuid .uuid4 )
7994 name = Column (String , nullable = False , unique = True )
80- version = Column (String , nullable = False )
8195 description = Column (String , nullable = True )
96+ project_id = Column (UUID (as_uuid = True ), nullable = False )
97+ version = Column (String , nullable = False )
8298 meta = Column (JSON , nullable = True , comment = "Additional metadata for the model" )
83- project_id = Column (String , nullable = False )
8499
85100 created_at = Column (DateTime (timezone = True ), default = datetime .now (UTC ))
86101 updated_at = Column (
@@ -95,6 +110,7 @@ class Metrics(Base):
95110 uuid = Column (UUID (as_uuid = True ), primary_key = True , default = uuid .uuid4 )
96111 key = Column (String , nullable = False )
97112 value = Column (Float , nullable = False )
113+ project_id = Column (UUID (as_uuid = True ), nullable = False )
98114 trial_id = Column (UUID (as_uuid = True ), nullable = False )
99115 step = Column (Integer , nullable = False , default = 0 )
100116 created_at = Column (DateTime (timezone = True ), default = datetime .now (UTC ))
0 commit comments