Skip to content

int类型为什么转成bool值了 #224

@tinnkai

Description

@tinnkai

生成出的结构体
Type bool gorm:"column:type;type:tinyint(1);not null;default:0" // 0增加,1减少

以下是表结构
CREATE TABLE account_log (
id int(11) unsigned NOT NULL AUTO_INCREMENT,
admin_id int(11) unsigned NOT NULL COMMENT '管理员ID',
user_id int(11) unsigned NOT NULL COMMENT '用户id',
type tinyint(1) NOT NULL DEFAULT '0' COMMENT '0增加,1减少',
event tinyint(3) NOT NULL COMMENT '操作类型,意义请看accountLog类',
time datetime NOT NULL COMMENT '发生时间',
note text COMMENT '备注',
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='账户余额日志表';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions