]> git.mxchange.org Git - friendica.git/blobdiff - database.sql
Issue 11508: Sanitizing date fields for events and polls
[friendica.git] / database.sql
index 5aa9a5b706904387975ee9156384080a7685d2d0..d13a3330c2b3a92c85d4118aff33321b9dbe7977 100644 (file)
@@ -1,6 +1,6 @@
 -- ------------------------------------------
 -- Friendica 2022.05-rc (Siberian Iris)
--- DB_UPDATE_VERSION 1461
+-- DB_UPDATE_VERSION 1462
 -- ------------------------------------------
 
 
@@ -1071,8 +1071,8 @@ CREATE TABLE IF NOT EXISTS `post-category` (
        `type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT '',
        `tid` int unsigned NOT NULL DEFAULT 0 COMMENT '',
         PRIMARY KEY(`uri-id`,`uid`,`type`,`tid`),
-        INDEX `uri-id` (`tid`),
-        INDEX `uid` (`uid`),
+        INDEX `tid` (`tid`),
+        INDEX `uid_uri-id` (`uid`,`uri-id`),
        FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
        FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE,
        FOREIGN KEY (`tid`) REFERENCES `tag` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT
@@ -1126,13 +1126,15 @@ CREATE TABLE IF NOT EXISTS `post-delivery` (
        `uid` mediumint unsigned COMMENT 'Delivering user',
        `created` datetime DEFAULT '0001-01-01 00:00:00' COMMENT '',
        `command` varbinary(32) COMMENT '',
+       `failed` tinyint DEFAULT 0 COMMENT 'Number of times the delivery has failed',
+       `receivers` mediumtext COMMENT 'JSON encoded array with the receiving contacts',
         PRIMARY KEY(`uri-id`,`inbox-id`),
         INDEX `inbox-id_created` (`inbox-id`,`created`),
         INDEX `uid` (`uid`),
        FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
        FOREIGN KEY (`inbox-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
        FOREIGN KEY (`uid`) REFERENCES `user` (`uid`) ON UPDATE RESTRICT ON DELETE CASCADE
-) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Status of ActivityPub inboxes';
+) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Delivery data for posts for the batch processing';
 
 --
 -- TABLE post-delivery-data
@@ -1191,6 +1193,7 @@ CREATE TABLE IF NOT EXISTS `post-media` (
        `publisher-image` varbinary(255) COMMENT 'Image of the publisher of the media',
         PRIMARY KEY(`id`),
         UNIQUE INDEX `uri-id-url` (`uri-id`,`url`),
+        INDEX `uri-id-id` (`uri-id`,`id`),
        FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Attached media';