column: 指定数据库中的字段名,例如:column:name。
type: 指定数据库中的字段类型,例如:type:varchar(255)。
size: 指定字段的大小,例如:size:255。
primaryKey: 指定该字段为主键,例如:primaryKey。
autoIncrement: 指定该字段自增,例如:autoIncrement。
default: 指定该字段的默认值,例如:default:0。
not null: 指定该字段为非空,例如:not null。
unique: 指定该字段为唯一,例如:unique。
index: 指定该字段需要建立索引,例如:index。
uniqueIndex: 指定该字段需要建立唯一索引,例如:uniqueIndex。
precision: 指定浮点数的精度,例如:precision:10。
scale: 指定浮点数的小数位数,例如:scale:2。
embedded: 指定该字段是嵌入式结构体,例如:embedded。
ignore: 指定该字段忽略,例如:ignore。
unique_index: 指定该字段需要建立唯一索引,例如:unique_index:idx_name_age。
notNull: 指定该字段为非空,例如:notNull。
foreignkey: 指定外键,例如:foreignkey:user_id。
assoc_foreignkey: 指定关联表的外键,例如:assoc_forei
GORM支持的全部标签
最新推荐文章于 2024-02-20 16:56:19 发布