· 8 years ago · Jul 24, 2018, 06:16 AM
1create database uic;
2use uic;
3set names utf8;
4
5drop table if exists team;
6CREATE TABLE `team` (
7 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
8 `name` varchar(64) NOT NULL,
9 `resume` varchar(255) not null default '',
10 `creator` int(10) unsigned NOT NULL DEFAULT '0',
11 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
12 PRIMARY KEY (`id`),
13 UNIQUE KEY `idx_team_name` (`name`)
14) ENGINE=InnoDB DEFAULT CHARSET=utf8;
15
16/**
17 * role: -1:blocked 0:normal 1:admin 2:root
18 */
19drop table if exists `user`;
20CREATE TABLE `user` (
21 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
22 `name` varchar(64) NOT NULL,
23 `passwd` varchar(64) not null default '',
24 `cnname` varchar(128) not null default '',
25 `email` varchar(255) not null default '',
26 `phone` varchar(16) not null default '',
27 `im` varchar(32) not null default '',
28 `qq` varchar(16) not null default '',
29 `role` tinyint not null default 0,
30 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
31 PRIMARY KEY (`id`),
32 UNIQUE KEY `idx_user_name` (`name`)
33) ENGINE=InnoDB DEFAULT CHARSET=utf8;
34
35drop table if exists `rel_team_user`;
36CREATE TABLE `rel_team_user` (
37 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
38 `tid` int(10) unsigned not null,
39 `uid` int(10) unsigned not null,
40 PRIMARY KEY (`id`),
41 KEY `idx_rel_tid` (`tid`),
42 KEY `idx_rel_uid` (`uid`)
43) ENGINE=InnoDB DEFAULT CHARSET=utf8;
44
45drop table if exists `session`;
46CREATE TABLE `session` (
47 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
48 `uid` int(10) unsigned not null,
49 `sig` varchar(128) not null,
50 `expired` int(10) unsigned not null,
51 PRIMARY KEY (`id`),
52 KEY `idx_session_uid` (`uid`),
53 UNIQUE KEY `idx_session_sig` (`sig`)
54) ENGINE=InnoDB DEFAULT CHARSET=utf8;