remove not null tag from scenario users field and add semicolons

This commit is contained in:
Sonja Happ 2019-09-03 15:24:13 +02:00
parent 36dfda1ac0
commit 0e96f643e5

View file

@ -27,7 +27,7 @@ type User struct {
// Role of user // Role of user
Role string `json:"role" gorm:"default:'user'"` Role string `json:"role" gorm:"default:'user'"`
// Scenarios to which user has access // Scenarios to which user has access
Scenarios []*Scenario `json:"-" gorm:"many2many:user_scenarios"` Scenarios []*Scenario `json:"-" gorm:"many2many:user_scenarios;"`
} }
// Scenario data model // Scenario data model
@ -40,7 +40,7 @@ type Scenario struct {
// Start parameters of scenario as JSON // Start parameters of scenario as JSON
StartParameters postgres.Jsonb `json:"startParameters"` StartParameters postgres.Jsonb `json:"startParameters"`
// Users that have access to the scenario // Users that have access to the scenario
Users []*User `json:"-" gorm:"not null;many2many:user_scenarios"` Users []*User `json:"-" gorm:"many2many:user_scenarios;"`
// SimulationModels that belong to the scenario // SimulationModels that belong to the scenario
SimulationModels []SimulationModel `json:"-" gorm:"foreignkey:ScenarioID" ` SimulationModels []SimulationModel `json:"-" gorm:"foreignkey:ScenarioID" `
// Dashboards that belong to the Scenario // Dashboards that belong to the Scenario