| 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, |
| 8 | is_admin bool default false, |
| 9 | state enum('pending', 'active', 'disabled') not null default 'pending', |
| 10 | |
| 11 | # Access |
| 12 | password char(40) default null, |
| 13 | token varchar(32) default null, |
| 14 | registration_date datetime not null, |
| 15 | |
| 16 | # Administrative tools |
| 17 | flags set('watch') not null default '', |
| 18 | comment varchar(255) default null, |
| 19 | |
| 20 | # User settings |
| 21 | full_name varchar(255) default null, |
| 22 | display_name varchar(255) default null, |
| 23 | sex enum('female', 'male') not null default 'male', |
| 24 | mail_format enum('plain', 'html') not null default 'html', |
| 25 | skin varchar(32) default null, |
| 26 | |
| 27 | primary key uid (uid), |
| 28 | unique key hruid (hruid), |
| 29 | key full_name (full_name), |
| 30 | key state (state), |
| 31 | key type (type) |
| 32 | ); |
| 33 | |
| 34 | CREATE TABLE account_types ( |
| 35 | type varchar(16) not null, |
| 36 | perms set('mail', 'groups', 'forums', 'list', 'search', 'portal') default '', |
| 37 | |
| 38 | primary key type (type) |
| 39 | ); |
| 40 | |
| 41 | CREATE TABLE account_profiles ( |
| 42 | uid int(6) not null, |
| 43 | pid int(6) not null, |
| 44 | perms set('owner') not null default '', |
| 45 | |
| 46 | primary key id (uid, pid), |
| 47 | key uid (uid), |
| 48 | key pid (pid) |
| 49 | ); |
| 50 | |
| 51 | # vim:set syntax=mysql: |