Blob Blame Raw
From 443ce0e848a0da4fa7c80dd5b077fb6b8a545126 Mon Sep 17 00:00:00 2001
From: Maik Qualmann <metzpinguin@gmail.com>
Date: Fri, 19 Jan 2018 07:07:08 +0100
Subject: [PATCH 11/32] disable foreign key checks temporarily for the Tags
 table BUGS: 388824

---
 data/database/dbconfig.xml.cmake.in | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/data/database/dbconfig.xml.cmake.in b/data/database/dbconfig.xml.cmake.in
index a1cd69f487..a98434b175 100644
--- a/data/database/dbconfig.xml.cmake.in
+++ b/data/database/dbconfig.xml.cmake.in
@@ -2141,6 +2141,7 @@
                                         ENGINE InnoDB;</statement>
                 <statement mode="plain">INSERT IGNORE INTO ImageCopyright SELECT * FROM ImageCopyright_old;</statement>
 
+                <statement mode="plain">SET FOREIGN_KEY_CHECKS=0;</statement>
                 <statement mode="plain">RENAME TABLE Tags TO Tags_old;</statement>
                 <statement mode="plain">CREATE TABLE Tags LIKE Tags_old;</statement>
                 <statement mode="plain">ALTER TABLE Tags
@@ -2154,6 +2155,7 @@
                                         (SELECT MAX(tr.rgt) FROM Tags AS tr));</statement>
                 <statement mode="plain">SET SQL_MODE=@OLD_SQL_MODE;</statement>
                 <statement mode="plain">UPDATE Tags SET icon = NULL WHERE icon = 0;</statement>
+                <statement mode="plain">SET FOREIGN_KEY_CHECKS=1;</statement>
 
                 <statement mode="plain">RENAME TABLE ImageTags TO ImageTags_old;</statement>
                 <statement mode="plain">CREATE TABLE ImageTags LIKE ImageTags_old;</statement>
-- 
2.14.3