11from datetime import datetime
22from uuid import UUID , uuid4
33
4- from sqlalchemy import DateTime
54from sqlmodel import Field , SQLModel
65
76from .base import BaseModel
@@ -21,21 +20,15 @@ class Jobs(JobsBase, BaseModel, table=True):
2120
2221 __tablename__ = "jobs"
2322
24- id : UUID = Field (default = uuid4 , primary_key = True )
23+ jobs_id : UUID = Field (default_factory = uuid4 , primary_key = True )
2524 started_at : datetime | None = Field (
2625 default_factory = datetime .utcnow ,
27- sa_type = DateTime (timezone = True ),
28- description = "Timestamp when the record was created" ,
2926 )
3027 updated_at : datetime | None = Field (
3128 default = None ,
32- sa_type = DateTime (timezone = True ),
33- description = "Timestamp when the record was updated" ,
3429 )
3530 finished_at : datetime | None = Field (
3631 default = None ,
37- sa_type = DateTime (timezone = True ),
38- description = "Timestamp when the record is finished" ,
3932 )
4033
4134
@@ -48,7 +41,7 @@ class JobsCreate(JobsBase):
4841class JobsRead (JobsBase ):
4942 """Jobs response model"""
5043
51- id : UUID
44+ jobs_id : UUID
5245 started_at : datetime | None = None
5346 finished_at : datetime | None = None
5447 created_at : datetime
0 commit comments