We have a lot of misconfigured associations in our pkg/model/database package.
When doing just a simple test implementation of Sqlite foreign key constraints (#145), I noticed that our invalid database model relations are really obstructing this. Maybe it will mess up our Postgres integration as well?
Actual
For example, the Project type should have many builds, but instead the Build model is set up to with a "has-one" relation to Project. I.e. an inverted model dependency
We have a lot of misconfigured associations in our
pkg/model/database
package.When doing just a simple test implementation of Sqlite foreign key constraints (#145), I noticed that our invalid database model relations are really obstructing this. Maybe it will mess up our Postgres integration as well?
Actual
For example, the
Project
type should have many builds, but instead theBuild
model is set up to with a "has-one" relation toProject
. I.e. an inverted model dependencyExpected
The
Project
model should have a "has-many" relation to theBuild
model, like so:Docs: https://gorm.io/docs/has_many.html