From 52c062adb6f1fc4eea1474fa1269e6afe8303799 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 11 Jul 2023 07:43:53 +0000 Subject: [PATCH] Fix "Cannot add or update a child row: a foreign key constraint fails" --- database.sql | 2 +- doc/database/db_report.md | 2 +- static/dbstructure.config.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/database.sql b/database.sql index 13158d1eaa..e9db927f1e 100644 --- a/database.sql +++ b/database.sql @@ -1695,7 +1695,7 @@ CREATE TABLE IF NOT EXISTS `report` ( `uid` mediumint unsigned COMMENT 'Reporting user', `reporter-id` int unsigned COMMENT 'Reporting contact', `cid` int unsigned NOT NULL COMMENT 'Reported contact', - `gsid` int unsigned NOT NULL COMMENT 'Reported contact server', + `gsid` int unsigned COMMENT 'Reported contact server', `comment` text COMMENT 'Report', `category-id` int unsigned NOT NULL DEFAULT 1 COMMENT 'Report category, one of Entity\Report::CATEGORY_*', `forward` boolean COMMENT 'Forward the report to the remote server', diff --git a/doc/database/db_report.md b/doc/database/db_report.md index d143839990..c2890e25a9 100644 --- a/doc/database/db_report.md +++ b/doc/database/db_report.md @@ -12,7 +12,7 @@ Fields | uid | Reporting user | mediumint unsigned | YES | | NULL | | | reporter-id | Reporting contact | int unsigned | YES | | NULL | | | cid | Reported contact | int unsigned | NO | | NULL | | -| gsid | Reported contact server | int unsigned | NO | | NULL | | +| gsid | Reported contact server | int unsigned | YES | | NULL | | | comment | Report | text | YES | | NULL | | | category-id | Report category, one of Entity\Report::CATEGORY_* | int unsigned | NO | | 1 | | | forward | Forward the report to the remote server | boolean | YES | | NULL | | diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 303e42e035..1a61d9f215 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -1691,7 +1691,7 @@ return [ "uid" => ["type" => "mediumint unsigned", "foreign" => ["user" => "uid"], "comment" => "Reporting user"], "reporter-id" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Reporting contact"], "cid" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["contact" => "id"], "comment" => "Reported contact"], - "gsid" => ["type" => "int unsigned", "not null" => "1", "foreign" => ["gserver" => "id"], "comment" => "Reported contact server"], + "gsid" => ["type" => "int unsigned", "foreign" => ["gserver" => "id"], "comment" => "Reported contact server"], "comment" => ["type" => "text", "comment" => "Report"], "category-id" => ["type" => "int unsigned", "not null" => 1, "default" => \Friendica\Moderation\Entity\Report::CATEGORY_OTHER, "comment" => "Report category, one of Entity\Report::CATEGORY_*"], "forward" => ["type" => "boolean", "comment" => "Forward the report to the remote server"], -- 2.39.5