File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11from .database import Base
22from sqlalchemy import TIMESTAMP , Column , String , Boolean
33from sqlalchemy .sql import func
4- from fastapi_utils .guid_type import GUID , GUID_SERVER_DEFAULT_POSTGRESQL
4+ from fastapi_utils .guid_type import GUID , GUID_DEFAULT_SQLITE
55
66
77class Note (Base ):
88 __tablename__ = 'notes'
9- id = Column (GUID , primary_key = True ,
10- server_default = GUID_SERVER_DEFAULT_POSTGRESQL )
9+ id = Column (GUID , primary_key = True , default = GUID_DEFAULT_SQLITE )
1110 title = Column (String , nullable = False )
1211 content = Column (String , nullable = False )
1312 category = Column (String , nullable = True )
14- published = Column (Boolean , nullable = False , server_default = ' True' )
13+ published = Column (Boolean , nullable = False , default = True )
1514 createdAt = Column (TIMESTAMP (timezone = True ),
1615 nullable = False , server_default = func .now ())
1716 updatedAt = Column (TIMESTAMP (timezone = True ),
You can’t perform that action at this time.
0 commit comments