From 6339e9e010e19cae27a8ae0198992f58c5bb96bf Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Mon, 14 Oct 2024 18:45:11 +0200 Subject: [PATCH] fixed the migration being not up to the model --- server/backend/migration/20241024000000.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/server/backend/migration/20241024000000.go b/server/backend/migration/20241024000000.go index 1a2c3fa1..69765222 100644 --- a/server/backend/migration/20241024000000.go +++ b/server/backend/migration/20241024000000.go @@ -2,14 +2,21 @@ package migration import ( "github.com/go-gormigrate/gormigrate/v2" + "github.com/guregu/null" "gorm.io/gorm" ) type newStudentCouncil struct { gorm.Model - Name string `gorm:"type:varchar(100)"` - Language string `gorm:"type:enum('German','English');default:'German'"` - Description string + Name string + Language string `gorm:"type:enum('German','English');default:'German'"` + Description null.String + LinkUrl null.String `gorm:"type:varchar(190);unique;"` + ImageID null.Int + Image *File `gorm:"foreignKey:ImageID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` + ImageCaption null.String + StudentCouncilCollectionID uint + StudentCouncilCollection newStudentCouncilCollection `gorm:"foreignKey:StudentCouncilCollectionID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` } // TableName sets the insert table name for this struct type