summaryrefslogtreecommitdiff
path: root/db/laconica.sql
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-08-19 18:12:14 -0400
committerEvan Prodromou <evan@prodromou.name>2008-08-19 18:12:14 -0400
commitc2a2da69667c2c18e26aabe757bd13ee6283b251 (patch)
tree80f02cd8a31cd525dbda2e63559f21495e39cd0d /db/laconica.sql
parentd1277820f81cfdab19678a89a312c9a9815d2b6a (diff)
add database tables for foreign services
darcs-hash:20080819221214-84dde-15683b1e146b9e29064aa8ae04bc7daebfaf2e92.gz
Diffstat (limited to 'db/laconica.sql')
-rw-r--r--db/laconica.sql35
1 files changed, 35 insertions, 0 deletions
diff --git a/db/laconica.sql b/db/laconica.sql
index 16faf53a0..da2a1c89d 100644
--- a/db/laconica.sql
+++ b/db/laconica.sql
@@ -251,3 +251,38 @@ create table notice_tag (
constraint primary key (tag, notice_id),
index notice_tag_created_idx (created)
) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin;
+
+/* Synching with foreign services */
+
+create table foreign_service (
+ id int not null primary key comment 'numeric key for service',
+ name varchar(32) not null unique key comment 'name of the service',
+ description varchar(255) comment 'description',
+ created datetime not null comment 'date this record was created',
+ modified timestamp comment 'date this record was modified'
+) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin;
+
+create table foreign_user (
+ id int not null comment 'unique numeric key on foreign service',
+ service int not null comment 'foreign key to service' references foreign_service(id),
+ uri varchar(255) not null unique key comment 'identifying URI',
+ nickname varchar(255) comment 'nickname on foreign service',
+ user_id int comment 'link to user on this system, if exists' references user (id),
+ credentials varchar(255) comment 'authc credentials, typically a password',
+ created datetime not null comment 'date this record was created',
+ modified timestamp comment 'date this record was modified',
+
+ constraint primary key (id, service),
+ index foreign_user_user_id_idx (user_id)
+) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin;
+
+create table foreign_subscription (
+ service int not null comment 'service where relationship happens' references foreign_service(id),
+ subscriber int not null comment 'subscriber on foreign service' references foreign_user (id),
+ subscribed int not null comment 'subscribed user' references foreign_user (id),
+ created datetime not null comment 'date this record was created',
+
+ constraint primary key (service, subscriber, subscribed),
+ index foreign_subscription_subscriber_idx (subscriber),
+ index foreign_subscription_subscribed_idx (subscribed)
+) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin;