-- ------------------------------------------
-- Friendica 2022.12-dev (Giant Rhubarb)
--- DB_UPDATE_VERSION 1493
+-- DB_UPDATE_VERSION 1495
-- ------------------------------------------
`comment` text COMMENT 'Report',
`forward` boolean COMMENT 'Forward the report to the remote server',
`created` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '',
+ `status` tinyint unsigned COMMENT 'Status of the report',
PRIMARY KEY(`id`),
INDEX `uid` (`uid`),
INDEX `cid` (`cid`),
CREATE TABLE IF NOT EXISTS `report-post` (
`rid` int unsigned NOT NULL COMMENT 'Report id',
`uri-id` int unsigned NOT NULL COMMENT 'Uri-id of the reported post',
+ `status` tinyint unsigned COMMENT 'Status of the reported post',
PRIMARY KEY(`rid`,`uri-id`),
INDEX `uri-id` (`uri-id`),
FOREIGN KEY (`rid`) REFERENCES `report` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
INNER JOIN `post` ON `post-collection`.`uri-id` = `post`.`uri-id`
INNER JOIN `post-thread` ON `post-thread`.`uri-id` = `post`.`parent-uri-id`;
+--
+-- VIEW media-view
+--
+DROP VIEW IF EXISTS `media-view`;
+CREATE VIEW `media-view` AS SELECT
+ `post-media`.`uri-id` AS `uri-id`,
+ `post-media`.`type` AS `type`,
+ `post`.`received` AS `received`,
+ `post`.`created` AS `created`,
+ `post`.`private` AS `private`,
+ `post`.`visible` AS `visible`,
+ `post`.`deleted` AS `deleted`,
+ `post`.`thr-parent-id` AS `thr-parent-id`,
+ `post`.`author-id` AS `author-id`,
+ `post`.`gravity` AS `gravity`
+ FROM `post-media`
+ INNER JOIN `post` ON `post-media`.`uri-id` = `post`.`uri-id`;
+
--
-- VIEW tag-view
--