go-gorm / playground

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

many2many fails when forgeignKey has check constraint #731

Open greencoda opened 7 months ago

greencoda commented 7 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.