Cascade on author deletion

This commit is contained in:
Michael 2022-08-16 04:18:29 +00:00
parent 4d617c9c48
commit bb52e5a804
3 changed files with 3 additions and 3 deletions

View file

@ -1159,7 +1159,7 @@ CREATE TABLE IF NOT EXISTS `post-collection` (
INDEX `type` (`type`), INDEX `type` (`type`),
INDEX `author-id` (`author-id`), INDEX `author-id` (`author-id`),
FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE, 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'; ) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Collection of posts';
-- --

View file

@ -759,7 +759,7 @@ class Processor
public static function createEvent(array $activity, array $item): int public static function createEvent(array $activity, array $item): int
{ {
$event['summary'] = HTML::toBBCode($activity['name'] ?: $activity['summary']); $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'])) { if (!empty($activity['start-time'])) {
$event['start'] = DateTimeFormat::utc($activity['start-time']); $event['start'] = DateTimeFormat::utc($activity['start-time']);
} }

View file

@ -1188,7 +1188,7 @@ return [
"fields" => [ "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"], "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"], "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" => [ "indexes" => [
"PRIMARY" => ["uri-id", "type"], "PRIMARY" => ["uri-id", "type"],