]> git.mxchange.org Git - friendica.git/blobdiff - database.sql
Delete item content for older item records
[friendica.git] / database.sql
index d084ba519c61edfb594ef393128b5da0a8ea0ee4..1a08a5ba980f6cfe7af8adfb67fbc7b0c15ca120 100644 (file)
@@ -1,6 +1,6 @@
 -- ------------------------------------------
 -- Friendica 2018.08-dev (The Tazmans Flax-lily)
--- DB_UPDATE_VERSION 1269
+-- DB_UPDATE_VERSION 1272
 -- ------------------------------------------
 
 
@@ -477,6 +477,7 @@ 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',
        `title` varchar(255) NOT NULL DEFAULT '' COMMENT 'item title',
        `content-warning` varchar(255) NOT NULL DEFAULT '' COMMENT '',
        `body` mediumtext COMMENT 'item body content',
@@ -541,9 +542,34 @@ CREATE TABLE IF NOT EXISTS `item` (
         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`)
+) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Structure for all posts';
+
+--
+-- 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',
+       `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
@@ -668,6 +694,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
 --
@@ -1084,19 +1123,6 @@ CREATE TABLE IF NOT EXISTS `user-item` (
         PRIMARY KEY(`uid`,`iid`)
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='User specific item data';
 
---
--- TABLE openwebauth-token
---
-CREATE TABLE IF NOT EXISTS `openwebauth-token` (
-       `id` int(10) NOT NULL auto_increment COMMENT 'sequential ID',
-       `uid` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'User id',
-       `type` varchar(32) DEFAULT '' COMMENT 'Verify type',
-       `token` varchar(255) DEFAULT '' COMMENT 'A generated token',
-       `meta` varchar(255) 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 worker-ipc
 --