]> git.mxchange.org Git - friendica.git/blobdiff - database.sql
Warnings fixed
[friendica.git] / database.sql
index bd36bdb70c406d3ed3eab91bd0608c53419f6f7a..15f5a2f352cd1f1f735b0f4ef2448d6f0333adaf 100644 (file)
@@ -1,6 +1,6 @@
 -- ------------------------------------------
 -- Friendica 2018.08-dev (The Tazmans Flax-lily)
--- DB_UPDATE_VERSION 1268
+-- DB_UPDATE_VERSION 1276
 -- ------------------------------------------
 
 
@@ -375,7 +375,7 @@ CREATE TABLE IF NOT EXISTS `group` (
 CREATE TABLE IF NOT EXISTS `group_member` (
        `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
        `gid` int unsigned NOT NULL DEFAULT 0 COMMENT 'groups.id of the associated group',
-       `contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'contact.id  of the member assigned to the associated group',
+       `contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT 'contact.id of the member assigned to the associated group',
         PRIMARY KEY(`id`),
         INDEX `contactid` (`contact-id`),
         UNIQUE INDEX `gid_contactid` (`gid`,`contact-id`)
@@ -477,6 +477,8 @@ CREATE TABLE IF NOT EXISTS `item` (
        `author-name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Name of the author of this item',
        `author-link` varchar(255) NOT NULL DEFAULT '' COMMENT 'Link to the profile page of the author of this item',
        `author-avatar` varchar(255) NOT NULL DEFAULT '' COMMENT 'Link to the avatar picture of the author of this item',
+       `icid` int unsigned COMMENT 'Id of the item-content table entry that contains the whole item content',
+       `iaid` int unsigned COMMENT 'Id of the item-activity table entry that contains the activity data',
        `title` varchar(255) NOT NULL DEFAULT '' COMMENT 'item title',
        `content-warning` varchar(255) NOT NULL DEFAULT '' COMMENT '',
        `body` mediumtext COMMENT 'item body content',
@@ -504,7 +506,6 @@ CREATE TABLE IF NOT EXISTS `item` (
        `pubmail` boolean NOT NULL DEFAULT '0' COMMENT '',
        `moderated` boolean NOT NULL DEFAULT '0' COMMENT '',
        `visible` boolean NOT NULL DEFAULT '0' COMMENT '',
-       `spam` boolean NOT NULL DEFAULT '0' COMMENT '',
        `starred` boolean NOT NULL DEFAULT '0' COMMENT 'item has been favourited',
        `bookmark` boolean NOT NULL DEFAULT '0' COMMENT 'item has been bookmarked',
        `unseen` boolean NOT NULL DEFAULT '1' COMMENT 'item has not been seen',
@@ -536,15 +537,52 @@ CREATE TABLE IF NOT EXISTS `item` (
         INDEX `ownerid` (`owner-id`),
         INDEX `uid_uri` (`uid`,`uri`(190)),
         INDEX `resource-id` (`resource-id`),
-        INDEX `contactid_allowcid_allowpid_denycid_denygid` (`contact-id`,`allow_cid`(10),`allow_gid`(10),`deny_cid`(10),`deny_gid`(10)),
-        INDEX `uid_type_changed` (`uid`,`type`,`changed`),
-        INDEX `contactid_verb` (`contact-id`,`verb`),
         INDEX `deleted_changed` (`deleted`,`changed`),
         INDEX `uid_wall_changed` (`uid`,`wall`,`changed`),
         INDEX `uid_eventid` (`uid`,`event-id`),
-        INDEX `uid_authorlink` (`uid`,`author-link`(190)),
-        INDEX `uid_ownerlink` (`uid`,`owner-link`(190))
-) DEFAULT COLLATE utf8mb4_general_ci COMMENT='All posts';
+        INDEX `icid` (`icid`),
+        INDEX `iaid` (`iaid`)
+) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Structure for all posts';
+
+--
+-- TABLE item-activity
+--
+CREATE TABLE IF NOT EXISTS `item-activity` (
+       `id` int unsigned NOT NULL auto_increment,
+       `uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
+       `uri-hash` char(80) NOT NULL DEFAULT '' COMMENT 'SHA-1 and RIPEMD-160 hash from uri',
+       `activity` smallint unsigned NOT NULL DEFAULT 0 COMMENT '',
+        PRIMARY KEY(`id`),
+        UNIQUE INDEX `uri-hash` (`uri-hash`),
+        INDEX `uri` (`uri`(191))
+) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Activities for items';
+
+--
+-- TABLE item-content
+--
+CREATE TABLE IF NOT EXISTS `item-content` (
+       `id` int unsigned NOT NULL auto_increment,
+       `uri` varchar(255) NOT NULL DEFAULT '' COMMENT '',
+       `uri-plink-hash` char(80) NOT NULL DEFAULT '' COMMENT 'SHA-1 hash from uri and plink',
+       `title` varchar(255) NOT NULL DEFAULT '' COMMENT 'item title',
+       `content-warning` varchar(255) NOT NULL DEFAULT '' COMMENT '',
+       `body` mediumtext COMMENT 'item body content',
+       `location` varchar(255) NOT NULL DEFAULT '' COMMENT 'text location where this item originated',
+       `coord` varchar(255) NOT NULL DEFAULT '' COMMENT 'longitude/latitude pair representing location where this item originated',
+       `language` text COMMENT 'Language information about this post',
+       `app` varchar(255) NOT NULL DEFAULT '' COMMENT 'application which generated this item',
+       `rendered-hash` varchar(32) NOT NULL DEFAULT '' COMMENT '',
+       `rendered-html` mediumtext COMMENT 'item.body converted to html',
+       `object-type` varchar(100) NOT NULL DEFAULT '' COMMENT 'ActivityStreams object type',
+       `object` text COMMENT 'JSON encoded object structure unless it is an implied object (normal post)',
+       `target-type` varchar(100) NOT NULL DEFAULT '' COMMENT 'ActivityStreams target type if applicable (URI)',
+       `target` text COMMENT 'JSON encoded target structure if used',
+       `plink` varchar(255) NOT NULL DEFAULT '' COMMENT 'permalink or URL to a displayable copy of the message at its source',
+       `verb` varchar(100) NOT NULL DEFAULT '' COMMENT 'ActivityStreams verb',
+        PRIMARY KEY(`id`),
+        UNIQUE INDEX `uri-plink-hash` (`uri-plink-hash`),
+        INDEX `uri` (`uri`(191))
+) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Content for all posts';
 
 --
 -- TABLE locks
@@ -553,8 +591,10 @@ CREATE TABLE IF NOT EXISTS `locks` (
        `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
        `name` varchar(128) NOT NULL DEFAULT '' COMMENT '',
        `locked` boolean NOT NULL DEFAULT '0' COMMENT '',
+       `expires` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'datetime of lock expiration',
        `pid` int unsigned NOT NULL DEFAULT 0 COMMENT 'Process ID',
-        PRIMARY KEY(`id`)
+        PRIMARY KEY(`id`),
+        INDEX `name_expires` (`name`,`expires`)
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='';
 
 --
@@ -669,6 +709,19 @@ CREATE TABLE IF NOT EXISTS `oembed` (
         INDEX `created` (`created`)
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='cache for OEmbed queries';
 
+--
+-- TABLE openwebauth-token
+--
+CREATE TABLE IF NOT EXISTS `openwebauth-token` (
+       `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
+       `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
+       `type` varchar(32) NOT NULL DEFAULT '' COMMENT 'Verify type',
+       `token` varchar(255) NOT NULL DEFAULT '' COMMENT 'A generated token',
+       `meta` varchar(255) NOT NULL DEFAULT '' COMMENT '',
+       `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'datetime of creation',
+        PRIMARY KEY(`id`)
+) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Store OpenWebAuth token to verify contacts';
+
 --
 -- TABLE parsed_url
 --
@@ -948,7 +1001,6 @@ CREATE TABLE IF NOT EXISTS `term` (
        `created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
        `received` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
        `global` boolean NOT NULL DEFAULT '0' COMMENT '',
-       `aid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
        `uid` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
         PRIMARY KEY(`tid`),
         INDEX `oid_otype_type_term` (`oid`,`otype`,`type`,`term`(32)),
@@ -976,7 +1028,6 @@ CREATE TABLE IF NOT EXISTS `thread` (
        `pubmail` boolean NOT NULL DEFAULT '0' COMMENT '',
        `moderated` boolean NOT NULL DEFAULT '0' COMMENT '',
        `visible` boolean NOT NULL DEFAULT '0' COMMENT '',
-       `spam` boolean NOT NULL DEFAULT '0' COMMENT '',
        `starred` boolean NOT NULL DEFAULT '0' COMMENT '',
        `ignored` boolean NOT NULL DEFAULT '0' COMMENT '',
        `bookmark` boolean NOT NULL DEFAULT '0' COMMENT '',