go-gorm / playground

GORM Playground (Please Create PR for this project to report issues)
MIT License
88 stars 666 forks source link

many2many fails when forgeignKey has check constraint #731

Open greencoda opened 2 months ago

greencoda commented 2 months ago

When creating a many2many relationship between 2 models, if there is a CHECK constraint on the primary key of one, that setting gets copied over to the same field of the many2many joinTable, where the column has a different name, which makes the check invalid.