]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - db/laconica.sql
Merge branch '0.8.x' of git@gitorious.org:laconica/dev into 0.8.x
[quix0rs-gnu-social.git] / db / laconica.sql
index 5b57494d984d6cee4b92b1b4e0f5b7325d283e0b..bc824fc4db4540830d2354672b6a454e064896f5 100644 (file)
@@ -114,8 +114,10 @@ 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"',
     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"',
+    conversation integer comment 'id of root notice in this conversation' references notice (id),
 
     index notice_profile_id_idx (profile_id),
 
     index notice_profile_id_idx (profile_id),
+    index notice_conversation_idx (conversation),
     index notice_created_idx (created),
     index notice_replyto_idx (reply_to),
     FULLTEXT(content)
     index notice_created_idx (created),
     index notice_replyto_idx (reply_to),
     FULLTEXT(content)
@@ -283,12 +285,14 @@ create table foreign_user (
 
 create table foreign_link (
      user_id int comment 'link to user on this system, if exists' references user (id),
 
 create table foreign_link (
      user_id int comment 'link to user on this system, if exists' references user (id),
-     foreign_id int comment 'link ' references foreign_user(id),
+     foreign_id bigint unsigned comment 'link to user on foreign service, if exists' references foreign_user(id),
      service int not null comment 'foreign key to service' references foreign_service(id),
      credentials varchar(255) comment 'authc credentials, typically a password',
      noticesync tinyint not null default 1 comment 'notice synchronization, bit 1 = sync outgoing, bit 2 = sync incoming, bit 3 = filter local replies',
      friendsync tinyint not null default 2 comment 'friend synchronization, bit 1 = sync outgoing, bit 2 = sync incoming',
      profilesync tinyint not null default 1 comment 'profile synchronization, bit 1 = sync outgoing, bit 2 = sync incoming',
      service int not null comment 'foreign key to service' references foreign_service(id),
      credentials varchar(255) comment 'authc credentials, typically a password',
      noticesync tinyint not null default 1 comment 'notice synchronization, bit 1 = sync outgoing, bit 2 = sync incoming, bit 3 = filter local replies',
      friendsync tinyint not null default 2 comment 'friend synchronization, bit 1 = sync outgoing, bit 2 = sync incoming',
      profilesync tinyint not null default 1 comment 'profile synchronization, bit 1 = sync outgoing, bit 2 = sync incoming',
+     last_noticesync datetime default null comment 'last time notices were imported',
+     last_friendsync datetime default null comment 'last time friends were imported',
      created datetime not null comment 'date this record was created',
      modified timestamp comment 'date this record was modified',
 
      created datetime not null comment 'date this record was created',
      modified timestamp comment 'date this record was modified',
 
@@ -421,3 +425,71 @@ create table group_inbox (
 
 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
 
 
 ) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
 
+create table file (
+    id integer primary key auto_increment,
+    url varchar(255) comment 'destination URL after following redirections',
+    mimetype varchar(50) comment 'mime type of resource',
+    size integer comment 'size of resource when available',
+    title varchar(255) comment 'title of resource when available',
+    date integer(11) comment 'date of resource according to http query',
+    protected integer(1) comment 'true when URL is private (needs login)',
+
+    unique(url)
+) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
+
+create table file_oembed (
+    id integer primary key auto_increment,
+    file_id integer comment 'oEmbed for that URL/file' references file (id),
+    version varchar(20) comment 'oEmbed spec. version',
+    type varchar(20) comment 'oEmbed type: photo, video, link, rich',
+    provider varchar(50) comment 'name of this oEmbed provider',
+    provider_url varchar(255) comment 'URL of this oEmbed provider',
+    width integer comment 'width of oEmbed resource when available',
+    height integer comment 'height of oEmbed resource when available',
+    html text comment 'html representation of this oEmbed resource when applicable',
+    title varchar(255) comment 'title of oEmbed resource when available',
+    author_name varchar(50) comment 'author name for this oEmbed resource',
+    author_url varchar(255) comment 'author URL for this oEmbed resource',
+    url varchar(255) comment 'URL for this oEmbed resource when applicable (photo, link)',
+
+    unique(file_id)
+) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci;
+
+create table file_redirection (
+    id integer primary key auto_increment,
+    url varchar(255) comment 'short URL (or any other kind of redirect) for file (id)',
+    file_id integer comment 'short URL for what URL/file' references file (id),
+    redirections integer comment 'redirect count',
+    httpcode integer comment 'HTTP status code (20x, 30x, etc.)',
+
+    unique(url)
+) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
+
+create table file_thumbnail (
+    id integer primary key auto_increment,
+    file_id integer comment 'thumbnail for what URL/file' references file (id),
+    url varchar(255) comment 'URL of thumbnail',
+    width integer comment 'width of thumbnail',
+    height integer comment 'height of thumbnail',
+
+    unique(file_id),
+    unique(url)
+) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
+
+create table file_to_post (
+    id integer primary key auto_increment,
+    file_id integer comment 'id of URL/file' references file (id),
+    post_id integer comment 'id of the notice it belongs to' references notice (id),
+
+    unique(file_id, post_id)
+) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
+
+create table group_block (
+   group_id integer not null comment 'group profile is blocked from' references user_group (id),
+   blocked integer not null comment 'profile that is blocked' references profile (id),
+   blocker integer not null comment 'user making the block' references user (id),
+   modified timestamp comment 'date of blocking',
+
+   constraint primary key (group_id, blocked)
+
+) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;