📜  不支持的数据类型和 gorm - Go 编程语言代码示例

📅  最后修改于: 2022-03-11 14:44:59.627000             🧑  作者: Mango

代码示例1
// 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"`
}