Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tinnkai opened this issue Nov 16, 2022 · 1 comment
Open

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

tinnkai opened this issue Nov 16, 2022 · 1 comment

Comments

@tinnkai
Copy link

tinnkai commented Nov 16, 2022

生成出的结构体
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='账户余额日志表';

@xxjwxc
Copy link
Owner

xxjwxc commented Nov 16, 2022

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants