]> git.mxchange.org Git - friendica.git/commitdiff
Fix "Cannot add or update a child row: a foreign key constraint fails"
authorMichael <heluecht@pirati.ca>
Tue, 11 Jul 2023 07:43:53 +0000 (07:43 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 11 Jul 2023 07:43:53 +0000 (07:43 +0000)
database.sql
doc/database/db_report.md
static/dbstructure.config.php

index 13158d1eaa9cac38fe9754ab9389d7c376192978..e9db927f1ef4bcbd20c75d3f114772bec6b5ae5b 100644 (file)
@@ -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',
index d143839990d4dd149d9eda89469f48b98ed9c7d7..c2890e25a917221616234c55c654a266c519f4bd 100644 (file)
@@ -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                |                |
index 303e42e035b66fadfaf3c8edaf2793931d133fdf..1a61d9f2158c14e051318a384a9eea5f0694b09a 100644 (file)
@@ -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"],