· 7 years ago · Sep 27, 2018, 12:04 AM
1create table if not exists tig_users (
2 uid bigint unsigned NOT NULL auto_increment,
3
4 -- Jabber User ID
5 user_id varchar(2049) NOT NULL,
6 -- UserID SHA1 hash to prevent duplicate user_ids
7 sha1_user_id char(128) NOT NULL,
8 -- User password encrypted or not
9 user_pw varchar(255) default NULL,
10 -- Time the account has been created
11 acc_create_time timestamp DEFAULT CURRENT_TIMESTAMP,
12 -- Time of the last user login
13 last_login timestamp DEFAULT 0,
14 -- Time of the last user logout
15 last_logout timestamp DEFAULT 0,
16 -- User online status, if > 0 then user is online, the value
17 -- indicates the number of user connections.
18 -- It is incremented on each user login and decremented on each
19 -- user logout.
20 online_status int default 0,
21 -- Number of failed login attempts
22 failed_logins int default 0,
23 -- User status, whether the account is active or disabled
24 -- >0 - account active, 0 - account disabled
25 account_status int default 1,
26
27 primary key (uid),
28 unique key sha1_user_id (sha1_user_id),
29 key user_pw (user_pw),
30 key user_id (user_id(765)),
31 key last_login (last_login),
32 key last_logout (last_logout),
33 key account_status (account_status),
34 key online_status (online_status)
35)
36ENGINE=InnoDB default character set utf8 ROW_FORMAT=DYNAMIC; --;