Checks for InnoDB

This commit is contained in:
Hillel Coren 2017-03-10 12:50:18 +02:00
parent d06ea6c72e
commit 5986759fe0

View File

@ -308,6 +308,14 @@ class AppController extends BaseController
// We need to make sure all tables are InnoDB to prevent migration failures
public function checkInnoDB()
{
$result = DB::select("SELECT engine
FROM information_schema.TABLES
WHERE TABLE_NAME='clients' AND TABLE_SCHEMA='ninja'");
if (count($result) && $result[0]->engine == 'InnoDB') {
return;
}
$tables = DB::select('SHOW TABLES');
$sql = "SET sql_mode = 'ALLOW_INVALID_DATES';\n";