Answers for "unsupported data type & gorm"

Go
0

unsupported data type & gorm

// add model like this
package models

type Student struct {
	gorm.Model
	Name     string      `gorm:"type:varchar;not null"`
	Npm      uint64      `gorm:"type:bigint;not null"`
	Fak      string      `gorm:"type:varchar;not null"`
	Bid      string      `gorm:"type:varchar;not null"`
	Teachers []uint 	 `gorm:"type:text[]"`
}

type Teacher struct {
	gorm.Model
	Name   string `gorm:"type:varchar;not null"`
	Matkul string `gorm:"type:varchar;not null"`
}
Posted by: Guest on October-06-2021

Browse Popular Code Answers by Language