Search before asking
What happened
Go code defines PrimaryKeys like that:
type PullRequestLabel struct {
PullRequestId string `json:"id" gorm:"primaryKey;type:varchar(255);comment:This key is generated based on details from the original plugin"` // format: <Plugin>:<Entity>:<PK0>:<PK1>
LabelName string `gorm:"primaryKey;type:varchar(255)"`
common.NoPKModel
}
and Python:
class PullRequestLabels(NoPKModel, table=True):
__tablename__ = 'pull_request_labels'
pull_request_id: str = Field(primary_key=True)
label_name: str
What do you expect to happen
they should align
How to reproduce
nothing to repro - this is problem in the code itself
Anything else
workaround is to use extend_existing to internally in the code expand definition:
class PullRequestLabels(NoPKModel, table=True):
"""
Domain model for pull_request_labels table with the correct composite PK.
Patches the vendored pydevlake.domain_layer.code.PullRequestLabels to use
a composite primary key (pull_request_id, label_name) matching the Go
DevLake domain layer definition.
"""
__tablename__ = "pull_request_labels"
__table_args__ = {"extend_existing": True}
pull_request_id: str = Field(primary_key=True)
label_name: str = Field(primary_key=True)
Version
f2de2dc
Are you willing to submit PR?
Code of Conduct
Search before asking
What happened
Go code defines PrimaryKeys like that:
and Python:
What do you expect to happen
they should align
How to reproduce
nothing to repro - this is problem in the code itself
Anything else
workaround is to use extend_existing to internally in the code expand definition:
Version
f2de2dc
Are you willing to submit PR?
Code of Conduct