diff --git a/internal/model/register.go b/internal/model/register.go index 4c7a7c8..0d6cdce 100644 --- a/internal/model/register.go +++ b/internal/model/register.go @@ -10,10 +10,10 @@ type RegisterRecord struct { Gender int32 `json:"gender" gorm:"column:gender;type:int;comment:性别1男2女"` PhoneNum string `json:"phone_num" gorm:"column:phone_num;type:varchar(255);not null;comment:手机号"` IdCard string `json:"id_card" gorm:"column:id_card;type:varchar(255);not null;comment:身份证号"` - Address string `json:"address" gorm:"column:address;type:varchar(6000);not null;comment:通讯地址"` - Address1 string `json:"address1" gorm:"column:address1;type:varchar(2000);not null;comment:详细地址"` - IdCardPhoto string `json:"id_card_photo" gorm:"column:id_card_photo;type:varchar(2000);not null;comment:身份证照片"` - IdCardBackPhoto string `json:"id_card_back_photo" gorm:"column:id_card_back_photo;type:varchar(2000);not null;comment:身份证照片背面"` - ArtistPhoto string `json:"artist_photo" gorm:"column:artist_photo;type:varchar(2000);not null;comment:画家本人近照"` - ArtworkFile string `json:"artwork_file" gorm:"column:artwork_file;type:varchar(2000);comment:作品文件"` + Address string `json:"address" gorm:"column:address;type:text;not null;comment:通讯地址"` + Address1 string `json:"address1" gorm:"column:address1;type:varchar(1000);not null;comment:详细地址"` + IdCardPhoto string `json:"id_card_photo" gorm:"column:id_card_photo;type:varchar(1000);not null;comment:身份证照片"` + IdCardBackPhoto string `json:"id_card_back_photo" gorm:"column:id_card_back_photo;type:varchar(1000);not null;comment:身份证照片背面"` + ArtistPhoto string `json:"artist_photo" gorm:"column:artist_photo;type:varchar(1000);not null;comment:画家本人近照"` + ArtworkFile string `json:"artwork_file" gorm:"column:artwork_file;type:varchar(1000);comment:作品文件"` } diff --git a/pkg/db/mysql.go b/pkg/db/mysql.go index f8f6837..d99b2b2 100644 --- a/pkg/db/mysql.go +++ b/pkg/db/mysql.go @@ -38,7 +38,7 @@ func loadMysqlConn(conn string) *gorm.DB { sqlDB.SetMaxIdleConns(20) //设置连接池,空闲 sqlDB.SetMaxOpenConns(100) //打开 sqlDB.SetConnMaxLifetime(time.Second * 30) - err = db.AutoMigrate(model.RegisterRecord{}) //自迁移 + err = db.AutoMigrate(&model.RegisterRecord{}) //自迁移 if err != nil { return nil