Commit | Line | Data |
---|---|---|
0eeb71ec FB |
1 | CREATE TABLE accounts ( |
2 | # Account identifier and type | |
3 | uid int(6) not null auto_increment, | |
4 | hruid varchar(255) not NULL, | |
5 | ||
6 | # Account type and state | |
7 | type varchar(16) default null, | |
791a11c8 | 8 | is_admin bool default false, |
0eeb71ec FB |
9 | state enum('pending', 'active', 'disabled') not null default 'pending', |
10 | ||
11 | # Access | |
12 | password char(40) default null, | |
c67ba12a | 13 | token varchar(32) default null, |
0511895d | 14 | weak_password varchar(256) default null, |
0eeb71ec FB |
15 | registration_date datetime not null, |
16 | ||
17 | # Administrative tools | |
18 | flags set('watch') not null default '', | |
19 | comment varchar(255) default null, | |
20 | ||
21 | # User settings | |
cb8a8977 | 22 | email varchar(255) default null, |
6457ddb4 FB |
23 | full_name varchar(255) default null, |
24 | display_name varchar(255) default null, | |
0eeb71ec | 25 | sex enum('female', 'male') not null default 'male', |
0907974b | 26 | email_format enum('text', 'html') not null default 'html', |
0eeb71ec | 27 | skin varchar(32) default null, |
0511895d | 28 | last_version varchar(16) not null, |
0eeb71ec FB |
29 | |
30 | primary key uid (uid), | |
31 | unique key hruid (hruid), | |
c67ba12a | 32 | key full_name (full_name), |
0eeb71ec FB |
33 | key state (state), |
34 | key type (type) | |
35 | ); | |
36 | ||
37 | CREATE TABLE account_types ( | |
38 | type varchar(16) not null, | |
39 | perms set('mail', 'groups', 'forums', 'list', 'search', 'portal') default '', | |
40 | ||
41 | primary key type (type) | |
42 | ); | |
43 | ||
44 | CREATE TABLE account_profiles ( | |
45 | uid int(6) not null, | |
46 | pid int(6) not null, | |
147310cf | 47 | perms set('owner') not null default '', |
0eeb71ec FB |
48 | |
49 | primary key id (uid, pid), | |
50 | key uid (uid), | |
51 | key pid (pid) | |
52 | ); | |
53 | ||
54 | # vim:set syntax=mysql: |