Skip to content
Discussion options

You must be logged in to vote

I feel like that primary keys in each table should be like this:

class Band_Member2(SQLModel,table=True):
    __table_name__ = "band_member"
    status: str = Field( default=None,description="Member Status code", sa_column_kwargs={"name":"member_status_code"})
    band_id: int = Field(
        default=None,
        description="Band ID",
        foreign_key="band.id", ## here band.band_id -> band.id
    )
    member_id: int = Field(
        default=None,
        description="Member ID",
        foreign_key="person.person_id", ## here person.person_id -> person.idd
        primary_key=True,
    )
    join_date: Optional[datetime] = Field(
        default=None, description="Date the band me…

Replies: 1 comment 1 reply

Comment options

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

Answer selected by YuriiMotov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
3 participants