Conversation
mxsrc
left a comment
There was a problem hiding this comment.
Thanks! I have some questions regarding this.
src/models/branch.py
Outdated
| ) | ||
| created_by: str = Field( | ||
| default="system", | ||
| sa_column=Column(String(255), nullable=False, server_default="system"), |
There was a problem hiding this comment.
Why do we need to specify this? All of the values should be derived automatically, the default can be set on the sqlmodel field.
08107e3 to
7e626d8
Compare
|
I was originally under the impression we are storing the name of the user. but actually for the user object there is ID field which is an UUID object. So I've reworked the PR so that we store UUID instead of str. Could you please have an other look. |
mxsrc
left a comment
There was a problem hiding this comment.
I still wonder about the sa_column definition.
| ) | ||
| created_by: UUID | None = Field( | ||
| default=None, | ||
| sa_column=Column(PGUUID(as_uuid=True), ForeignKey("user.id"), nullable=True), |
There was a problem hiding this comment.
Why are we specifying sa_column here? Of these values, only foreign key needs to be specified, and that via the Field keyword argument.
|
Is this still on? |
created_byfield in database"pgadmin_pwd" # TODO: auto generate this in the next PR.removed this TODO because we already auto generate PG Bouncer password and store it in database