Make clearing existing test tables work again for MySQL.

This commit is contained in:
Azareal 2019-05-08 17:36:47 +10:00
parent 1fd980bf56
commit 76ca755b90
1 changed files with 7 additions and 1 deletions

View File

@ -114,6 +114,11 @@ func (ins *MysqlInstaller) InitDatabase() (err error) {
} }
fmt.Println("Successfully connected to the database") fmt.Println("Successfully connected to the database")
_, err = db.Exec("SET FOREIGN_KEY_CHECKS = 0;")
if err != nil {
return err
}
// Ready the query builder // Ready the query builder
ins.db = db ins.db = db
qgen.Builder.SetConn(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 // ? - Moved this here since it was breaking the installer, we need to add this at some point