· 10 years ago · Sep 22, 2016, 10:46 PM
1## create table
2## use key here
3
4create table if not exists tig_users (
5 uid bigint unsigned NOT NULL auto_increment,
6 user_id varchar(2049) NOT NULL,
7 sha1_user_id char(128) NOT NULL,
8 user_pw varchar(255) default NULL,
9 acc_create_time timestamp DEFAULT CURRENT_TIMESTAMP,
10 last_login timestamp DEFAULT 0,
11 last_logout timestamp DEFAULT 0,
12 online_status int default 0,
13 failed_logins int default 0,
14 account_status int default 1,
15
16 primary key (uid),
17 unique key sha1_user_id (sha1_user_id),
18 key user_pw (user_pw),
19 key last_login (last_login),
20 key last_logout (last_logout),
21 key account_status (account_status),
22 key online_status (online_status)
23)
24ENGINE=InnoDB default character set utf8 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;