+--
+-- TABLE post-history
+--
+CREATE TABLE IF NOT EXISTS `post-history` (
+ `uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri',
+ `edited` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT 'Date of edit',
+ `title` varchar(255) NOT NULL DEFAULT '' COMMENT 'item title',
+ `content-warning` varchar(255) NOT NULL DEFAULT '' COMMENT '',
+ `body` mediumtext COMMENT 'item body content',
+ `raw-body` mediumtext COMMENT 'Body without embedded media links',
+ `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',
+ `resource-id` varchar(32) NOT NULL DEFAULT '' COMMENT 'Used to link other tables to items, it identifies the linked resource (e.g. photo) and if set must also set resource_type',
+ `plink` varchar(255) NOT NULL DEFAULT '' COMMENT 'permalink or URL to a displayable copy of the message at its source',
+ PRIMARY KEY(`uri-id`,`edited`),
+ FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
+) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Post history';
+