/* local and remote users have profiles */\r
\r
+create sequence profile_seq;\r
create table profile (\r
- id serial primary key /* comment 'unique identifier' */,\r
+ id bigint default nextval('profile_seq') primary key /* comment 'unique identifier' */,\r
nickname varchar(64) not null /* comment 'nickname or username' */,\r
fullname varchar(255) /* comment 'display name' */,\r
profileurl varchar(255) /* comment 'URL, cached so we dont regenerate' */,\r
);\r
create index avatar_profile_id_idx on avatar using btree(profile_id);\r
\r
+create sequence sms_carrier_seq;\r
create table sms_carrier (\r
- id serial primary key /* comment 'primary key for SMS carrier' */,\r
+ id bigint default nextval('sms_carrier_seq') primary key /* comment 'primary key for SMS carrier' */,\r
name varchar(64) unique /* comment 'name of the carrier' */,\r
email_pattern varchar(255) not null /* comment 'sprintf pattern for making an email address from a phone number' */,\r
created timestamp not null default CURRENT_TIMESTAMP /* comment 'date this record was created' */,\r
create index subscription_subscriber_idx on subscription using btree(subscriber);\r
create index subscription_subscribed_idx on subscription using btree(subscribed);\r
\r
+create sequence notice_seq;\r
create table notice (\r
\r
- id serial primary key /* comment 'unique identifier' */,\r
+ id bigint default nextval('notice_seq') primary key /* comment 'unique identifier' */,\r
profile_id integer not null /* comment 'who made the update' */ references profile (id) ,\r
uri varchar(255) unique /* comment 'universally unique identifier, usually a tag URI' */,\r
content varchar(140) /* comment 'update content' */,\r
create table nonce (\r
consumer_key varchar(255) not null /* comment 'unique identifier, root URL' */,\r
tok char(32) not null /* comment 'identifying value' */,\r
- nonce char(32) not null /* comment 'nonce' */,\r
+ nonce char(32) null /* comment 'buggy old value, ignored */,\r
ts integer not null /* comment 'timestamp sent' values are epoch, and only used internally */,\r
\r
created timestamp not null default CURRENT_TIMESTAMP /* comment 'date this record was created' */,\r
modified timestamp /* comment 'date this record was modified' */,\r
\r
- primary key (consumer_key, tok, nonce),\r
- foreign key (consumer_key, tok) references token (consumer_key, tok)\r
+ primary key (consumer_key, ts, nonce)\r
);\r
\r
/* One-to-many relationship of user to openid_url */\r
create index invitation_address_idx on invitation using btree(address,address_type);\r
create index invitation_user_id_idx on invitation using btree(user_id);\r
\r
+create sequence message_seq;\r
create table message (\r
\r
- id serial primary key /* comment 'unique identifier' */,\r
+ id bigint default nextval('message_seq') primary key /* comment 'unique identifier' */,\r
uri varchar(255) unique /* comment 'universally unique identifier' */,\r
from_profile integer not null /* comment 'who the message is from' */ references profile (id),\r
to_profile integer not null /* comment 'who the message is to' */ references profile (id),\r
\r
);\r
\r
+create sequence user_group_seq;\r
create table user_group (\r
\r
- id serial primary key /* comment 'unique identifier' */,\r
+ id bigint default nextval('user_group_seq') primary key /* comment 'unique identifier' */,\r
\r
nickname varchar(64) unique /* comment 'nickname for addressing' */,\r
fullname varchar(255) /* comment 'display name' */,\r