如何描述复合 UNIQUE 键的 gorm 标签?
Postgres:
phone_country_code VARCHAR(10),
phone_number VARCHAR(25),
CONSTRAINT phone_country_code_number UNIQUE (phone_country_code, phone_number)
Go(模型结构的字段):
PhoneCountryCode string `gorm:"column:phone_country_code; type:VARCHAR(10)"`
PhoneNumber string `gorm:"column:phone_number; type:VARCHAR(25)"`
PIPIONE
小怪兽爱吃肉
随时随地看视频慕课网APP
相关分类