Skip to content
Discussion options

You must be logged in to vote

Iam posting this to avoid the same mistake by other
The issue was in another line of code, where i missed the Field

    created_on: datetime =Column(
        DateTime(timezone=True),
        server_default=func.now()
        )
    updated_on: datetime = Column(
        DateTime(timezone=True),
        server_default=func.now(),
        server_onupdate=func.now()
        )

corrected code is as follows

    created_on: datetime = Field(sa_column=Column(
        DateTime(timezone=True),
        server_default=func.now()
        ))
    updated_on: datetime = Field(sa_column=Column(
        DateTime(timezone=True),
        server_default=func.now(),
        server_onupdate=func.now()
        ))

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@muscodev
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by muscodev
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
2 participants