21 lines
848 B
Go
21 lines
848 B
Go
|
package models
|
||
|
|
||
|
import (
|
||
|
"dev.sum7.eu/genofire/golang-lib/database"
|
||
|
)
|
||
|
|
||
|
type DateMeet struct {
|
||
|
ID int `gorm:"PRIMARY_KEY" json:"id"`
|
||
|
DateID int `sql:"type:bigint NOT NULL REFERENCES date(id);column:date_id" json:"dateID,omitempty"`
|
||
|
Date *Date `gorm:"association_autoupdate:false;foreignkey:DateID;" json:"date,omitempty"`
|
||
|
PersonID int `sql:"type:bigint NOT NULL REFERENCES person(id);column:person_id" json:"personID,omitempty"`
|
||
|
Person *Person `gorm:"association_autoupdate:false;foreignkey:PersonID;" json:"person,omitempty"`
|
||
|
JobID int `sql:"type:bigint NOT NULL REFERENCES job(id);column:job_id" json:"jobID,omitempty"`
|
||
|
Job *Job `gorm:"association_autoupdate:false;foreignkey:JobID;" json:"job,omitempty"`
|
||
|
}
|
||
|
|
||
|
// Function to initialize the database
|
||
|
func init() {
|
||
|
database.AddModel(&DateMeet{})
|
||
|
}
|