Skip to content

create branch: store created_by#275

Open
boddumanohar wants to merge 1 commit intomainfrom
implement-created-by
Open

create branch: store created_by#275
boddumanohar wants to merge 1 commit intomainfrom
implement-created-by

Conversation

@boddumanohar
Copy link
Member

  • store the user who created the branch in created_by field 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

@boddumanohar boddumanohar requested a review from mxsrc November 14, 2025 11:08
Copy link
Collaborator

@mxsrc mxsrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I have some questions regarding this.

)
created_by: str = Field(
default="system",
sa_column=Column(String(255), nullable=False, server_default="system"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to specify this? All of the values should be derived automatically, the default can be set on the sqlmodel field.

@boddumanohar
Copy link
Member Author

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.

Copy link
Collaborator

@mxsrc mxsrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we specifying sa_column here? Of these values, only foreign key needs to be specified, and that via the Field keyword argument.

@noctarius
Copy link
Collaborator

Is this still on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants