From 76ca755b90534395ddee80a1f0b81f4c5563aa8d Mon Sep 17 00:00:00 2001 From: Azareal Date: Wed, 8 May 2019 17:36:47 +1000 Subject: [PATCH] Make clearing existing test tables work again for MySQL. --- install/mysql.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/install/mysql.go b/install/mysql.go index f4089792..8949c44d 100644 --- a/install/mysql.go +++ b/install/mysql.go @@ -114,6 +114,11 @@ func (ins *MysqlInstaller) InitDatabase() (err error) { } fmt.Println("Successfully connected to the database") + _, err = db.Exec("SET FOREIGN_KEY_CHECKS = 0;") + if err != nil { + return err + } + // Ready the query builder ins.db = db qgen.Builder.SetConn(db) @@ -229,7 +234,8 @@ Outer: } } - return nil + _, err = ins.db.Exec("SET FOREIGN_KEY_CHECKS = 1;") + return err } // ? - Moved this here since it was breaking the installer, we need to add this at some point