]> git.mxchange.org Git - friendica.git/commitdiff
Cascade on author deletion
authorMichael <heluecht@pirati.ca>
Tue, 16 Aug 2022 04:18:29 +0000 (04:18 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 16 Aug 2022 04:18:29 +0000 (04:18 +0000)
database.sql
src/Protocol/ActivityPub/Processor.php
static/dbstructure.config.php

index 417eddfcdec2ef6c69737873158026470af8b4b5..40abb7f05624e819fa80bc44d89b5d699d0438af 100644 (file)
@@ -1159,7 +1159,7 @@ CREATE TABLE IF NOT EXISTS `post-collection` (
         INDEX `type` (`type`),
         INDEX `author-id` (`author-id`),
        FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE,
-       FOREIGN KEY (`author-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT
+       FOREIGN KEY (`author-id`) REFERENCES `contact` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
 ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Collection of posts';
 
 --
index 5413e32841b82586504f9f2d86a6d23721c87350..61f625f597fc2f380c9d323262462cac490122b6 100644 (file)
@@ -759,7 +759,7 @@ class Processor
        public static function createEvent(array $activity, array $item): int
        {
                $event['summary']   = HTML::toBBCode($activity['name'] ?: $activity['summary']);
-               $event['desc']      = HTML::toBBCode($activity['content']);
+               $event['desc']      = HTML::toBBCode($activity['content'] ?? '');
                if (!empty($activity['start-time'])) {
                        $event['start']  = DateTimeFormat::utc($activity['start-time']);
                }
index fc5be58dd8614f61445ab4dc56e8927ad548a904..81f03fbf31a0a8fdb365dd2ecd7147ab8ce5a3d0 100644 (file)
@@ -1188,7 +1188,7 @@ return [
                "fields" => [
                        "uri-id" => ["type" => "int unsigned", "not null" => "1", "primary" => "1", "foreign" => ["item-uri" => "id"], "comment" => "Id of the item-uri table entry that contains the item uri"],
                        "type" => ["type" => "tinyint unsigned", "not null" => "1", "default" => "0", "primary" => "1", "comment" => "0 - Featured"],
-                       "author-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id", "on delete" => "restrict"], "comment" => "Author of the featured post"],
+                       "author-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Author of the featured post"],
                ],
                "indexes" => [
                        "PRIMARY" => ["uri-id", "type"],