X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=db%2Flaconica.sql;h=da2a1c89dfff14245a7c066843c5197480ef5ea8;hb=6593092bfd08efa9fe5dbd83a85a4fe1cac2b936;hp=3615340c1ffd8652159b50a3946c2b76fcb5ac56;hpb=95b4d89742093af5b033f314bb45d33185614a79;p=quix0rs-gnu-social.git diff --git a/db/laconica.sql b/db/laconica.sql index 3615340c1f..da2a1c89df 100644 --- a/db/laconica.sql +++ b/db/laconica.sql @@ -65,7 +65,7 @@ create table user ( autosubscribe tinyint default 0 comment 'automatically subscribe to users who subscribe to us', created datetime not null comment 'date this record was created', modified timestamp comment 'date this record was modified', - + index user_smsemail_idx (smsemail) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin; @@ -106,7 +106,7 @@ create table notice ( reply_to integer comment 'notice replied to (usually a guess)' references notice (id), is_local tinyint default 0 comment 'notice was generated by a user', source varchar(32) comment 'source of comment, like "web", "im", or "clientname"', - + index notice_profile_id_idx (profile_id), index notice_created_idx (created), FULLTEXT(content) @@ -134,6 +134,19 @@ create table reply ( ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin; +create table fave ( + + notice_id integer not null comment 'notice that is the favorite' references notice (id), + user_id integer not null comment 'user who likes this notice' references user (id), + modified timestamp not null comment 'date this record was modified', + + constraint primary key (notice_id, user_id), + index fave_notice_id_idx (notice_id), + index fave_user_id_idx (user_id), + index fave_modified_idx (modified) + +) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin; + /* tables for OAuth */ create table consumer ( @@ -238,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;