1 /* local and remote users have profiles */
4 id integer auto_increment primary key comment 'unique identifier',
5 nickname varchar(64) not null comment 'nickname or username',
6 fullname varchar(255) comment 'display name',
7 profileurl varchar(255) comment 'URL, cached so we dont regenerate',
8 homepage varchar(255) comment 'identifying URL',
9 bio varchar(140) comment 'descriptive biography',
10 location varchar(255) comment 'physical location',
11 created datetime not null comment 'date this record was created',
12 modified timestamp comment 'date this record was modified',
14 index profile_nickname_idx (nickname)
18 profile_id integer not null comment 'foreign key to profile table' references profile (id),
19 original boolean default false comment 'uploaded by user or generated?',
20 width integer not null comment 'image width',
21 height integer not null comment 'image height',
22 mediatype varchar(32) not null comment 'file type',
23 filename varchar(255) null comment 'local filename, if local',
24 url varchar(255) unique key comment 'avatar location',
26 constraint primary key (profile_id, width, height),
27 index avatar_profile_id_idx (profile_id),
33 id integer primary key comment 'foreign key to profile table' references profile (id),
34 nickname varchar(64) unique key comment 'nickname or username, duped in profile',
35 password varchar(255) comment 'salted password, can be null for OpenID users',
36 email varchar(255) unique key comment 'email address for password recovery etc.',
37 created datetime not null comment 'date this record was created',
38 modified timestamp comment 'date this record was modified'
43 create table remote_profile (
44 id integer primary key comment 'foreign key to profile table' references profile (id),
45 url varchar(255) unique key comment 'URL we use for updates from this profile (distinct from "home page" url)',
46 created datetime not null comment 'date this record was created',
47 modified timestamp comment 'date this record was modified'
50 create table subscription (
51 subscriber integer not null comment 'profile listening',
52 subscribed integer not null comment 'profile being listened to',
53 token varchar(255) comment 'authorization token',
54 created datetime not null comment 'date this record was created',
55 modified timestamp comment 'date this record was modified',
57 constraint primary key (subscriber, subscribed),
58 index subscription_subscriber_idx (subscriber),
59 index subscription_subscribed_idx (subscribed)
63 id integer auto_increment primary key comment 'unique identifier',
64 profile_id integer not null comment 'who made the update' references profile (id),
65 content varchar(140) comment 'update content',
66 /* XXX: cache rendered content. */
67 url varchar(255) comment 'URL of any attachment (image, video, bookmark, whatever)',
68 created datetime not null comment 'date this record was created',
69 modified timestamp comment 'date this record was modified',
71 index notice_profile_id_idx (profile_id)