Checks for InnoDB

This commit is contained in:
Hillel Coren 2017-03-10 12:48:23 +02:00
parent a0631dae03
commit 70b7167d56
2 changed files with 9 additions and 0 deletions

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";

View File

@ -62,6 +62,7 @@ return [
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => env('DB_STRICT', false),
'engine' => 'InnoDB',
],
'pgsql' => [