You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generally, An SQL statement can have only one primary key
Yes, a SQL relation (I guess this is what you meant with statement, because a statement does not have a primary key, it might specify one, if it's a DDL statement) can only have one primary key, hence the name primary key.
But that is completely unrelated to this issue. I don't want multiple primary keys, that would be insane 😅
What I want is a composite primary key, which as per documentation gorm supports: https://gorm.io/docs/composite_primary_key.html and as I said already: It was even working in older versions
GORM Playground Link
go-gorm/playground#712
Description
For the following model
this SQL DDL is generated
Notice: The
user_id
is missing thePRIMARY KEY
constraintIt worked fine with
gorm.io/driver/sqlite v1.5.3
but is broken ingorm.io/driver/sqlite v1.5.4
The text was updated successfully, but these errors were encountered: