 
 CREATE TABLE `u1_history` (
   `id` bigint(20) NOT NULL COMMENT '序号',
-  `userhash` char(64) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT '用户哈希',
-  `apptoken` char(64) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT 'APP密钥',
-  `session` char(64) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT '会话代码',
+  `userhash` char(64) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL COMMENT '用户哈希',
+  `apptoken` char(64) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL COMMENT 'APP密钥',
+  `session` char(64) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL COMMENT '会话代码',
+  `ipid` int(11) NOT NULL COMMENT 'IP表id',
   `time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '发生时间',
-  `operation` tinytext COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT '执行操作',
+  `operation` enum('USER_SIGN_UP','USER_SIGN_IN','') CHARACTER SET ascii DEFAULT NULL COMMENT '执行操作',
   `sender` tinytext COLLATE utf8mb4_unicode_520_ci COMMENT '发送者',
   `receiver` tinytext COLLATE utf8mb4_unicode_520_ci COMMENT '接收者',
   `process` longtext COLLATE utf8mb4_unicode_520_ci COMMENT '过程',
   `result` longtext COLLATE utf8mb4_unicode_520_ci COMMENT '结果',
-  `auditadmin` char(64) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT '审核员哈希',
+  `auditadmin` char(64) CHARACTER SET ascii COLLATE ascii_bin DEFAULT NULL COMMENT '审核员哈希',
   `audittime` datetime DEFAULT NULL COMMENT '审核时间',
   `auditresult` tinytext COLLATE utf8mb4_unicode_520_ci COMMENT '审核意见'
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;


CREATE TABLE `u1_totp` (
  `id` int(11) NOT NULL COMMENT 'ID',
  `secret` char(16) COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT '钥匙内容',
  `apptoken` char(64) COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT '钥匙访问代码',
  `ipid` int(11) NOT NULL COMMENT 'IP地址ID',
  `appid` tinytext COLLATE utf8mb4_unicode_520_ci NOT NULL COMMENT '已注册应用ID',
  `time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '生成时间',
  `c_code` char(6) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL COMMENT '验证码',
  `c_time` datetime DEFAULT NULL COMMENT '验证码生成时间',
  `c_img` text COLLATE utf8mb4_unicode_520_ci COMMENT '验证码网址'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;

-- --------------------------------------------------------


-- 表的索引 `u1_protection`
--
ALTER TABLE `u1_protection`
  ADD PRIMARY KEY (`id`) USING BTREE,
  ADD UNIQUE KEY `userhash` (`userhash`),
  ADD UNIQUE KEY `idnumber` (`idnumber`),
  ADD UNIQUE KEY `recovery1` (`recovery1`,`recovery2`,`recovery3`,`recovery4`,`recovery5`);

--
-- 表的索引 `u1_session`
--
ALTER TABLE `u1_session`
  ADD PRIMARY KEY (`id`) USING BTREE,
  ADD UNIQUE KEY `token` (`token`);

--
-- 表的索引 `u1_totp`
--
ALTER TABLE `u1_totp`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `secret` (`secret`),
  ADD UNIQUE KEY `apptoken` (`apptoken`);

--
-- 表的索引 `u1_usergroup`
