user table

2023-07-07 14:19:29 浏览数 (1)

代码语言:javascript复制
CREATE TABLE `user1` (
  `user_id` varchar(100) NOT NULL COMMENT '用户ID',
  `user_name` varchar(100) DEFAULT NULL COMMENT '用户名',
  `user_password` varchar(100) DEFAULT NULL COMMENT '密码',
  `user_token` varchar(100) DEFAULT NULL COMMENT '令牌',
  `user_nick` varchar(100) COMMENT '昵称',
  `user_createtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `user_updatetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `user_type` varchar(100) DEFAULT NULL COMMENT '类型ID',
  `login_count` int(11) DEFAULT NULL COMMENT '登录数',
  `pay_count` int(11) DEFAULT NULL COMMENT '购买数',
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT IGNORE INTO `cloud_note`.`user1` (`user_id`, `user_name`, `user_password`, `user_token`, `user_nick`, `user_createtime`, `user_updatetime`, `user_type`, `login_count`, `pay_count`) VALUES ('1', '130', '123456', 'ss', 'ss', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, NULL, NULL, NULL);
UPDATE `cloud_note`.`user1` SET `login_count` =`login_count`  '1' WHERE `user1`.`user_id` = '1'
UPDATE `cloud_note`.`user1` SET `user_createtime` = CURRENT_TIME(), `login_count` = '1' WHERE `user1`.`user_id` = '1';

数据库

代码语言:javascript复制
CREATE TABLE `user2` (
  `user_id` varchar(100) NOT NULL COMMENT '用户ID',
  `user_name` varchar(100) DEFAULT NULL COMMENT '用户名',
  `user_password` varchar(100) DEFAULT NULL COMMENT '密码或者机器码machinecode',
  `user_token` varchar(100) DEFAULT NULL COMMENT '令牌',
  `user_nick` varchar(100) COMMENT '昵称',
  `user_createtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `user_updatetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `user_starttime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '开始时间',
  `user_endtime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '结束时间=开始时间 数量',
  `user_type` varchar(100) DEFAULT NULL COMMENT '类型ID或者用户状态status',
  `login_count` int(11) DEFAULT NULL COMMENT '登录数',
  `pay_count` int(11) DEFAULT NULL COMMENT '购买数或者使用数量',
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `cloud`.`user2` (
	`user_id`, `user_name`, `user_password`, 
	`user_token`, `user_nick`, `user_createtime`, 
	`user_updatetime`, `user_starttime`, 
	`user_endtime`, `user_type`, `login_count`, 
	`pay_count`
) 
VALUES 
	(
		'1', '185', NULL, NULL, NULL, CURRENT_TIMESTAMP, 
		CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 
		CURRENT_TIMESTAMP, NULL, NULL, NULL
	);
UPDATE `cloud`.`user2` SET `pay_count` = '1' WHERE `user2`.`user_id` = '1';

0 人点赞