@@ -10,21 +10,27 @@ class TimeEntriesDao(CRUDDao):
10
10
def create_dao () -> TimeEntriesDao :
11
11
from time_tracker_api .sql_repository import db
12
12
from time_tracker_api .database import COMMENTS_MAX_LENGTH
13
- from time_tracker_api .sql_repository import SQLCRUDDao , AuditedSQLModel
13
+ from time_tracker_api .sql_repository import SQLCRUDDao
14
+ from sqlalchemy_utils import UUIDType
15
+ import uuid
14
16
15
- class TimeEntrySQLModel (db .Model , AuditedSQLModel ):
17
+ class TimeEntrySQLModel (db .Model ):
16
18
__tablename__ = 'time_entry'
17
- id = db .Column (db . Integer , primary_key = True )
19
+ id = db .Column (UUIDType ( binary = False ) , primary_key = True , default = uuid . uuid4 )
18
20
description = db .Column (db .String (COMMENTS_MAX_LENGTH ))
19
21
start_date = db .Column (db .DateTime , server_default = db .func .now ())
20
22
end_date = db .Column (db .DateTime )
21
- project_id = db .Column (db . Integer ,
23
+ project_id = db .Column (UUIDType ( binary = False ) ,
22
24
db .ForeignKey ('project.id' ),
23
25
nullable = False )
24
- activity_id = db .Column (db . Integer ,
26
+ activity_id = db .Column (UUIDType ( binary = False ) ,
25
27
db .ForeignKey ('activity.id' ),
26
28
nullable = False )
27
29
technologies = db .Column (ScalarListType ())
30
+ uri = db .Column (db .String (500 ))
31
+ owner_id = db .Column (UUIDType (binary = False ), default = uuid .uuid4 )
32
+ deleted = db .Column (UUIDType (binary = False ), default = uuid .uuid4 )
33
+ tenant_id = db .Column (UUIDType (binary = False ), default = uuid .uuid4 )
28
34
29
35
@property
30
36
def running (self ):
0 commit comments