From fb6b51b1cfef0af399607fe038603c8240800b2b Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Thu, 29 Nov 2018 23:21:58 +0100 Subject: [PATCH] Set InnoDB for DB connection and new tables Refs #1661. --- src/Database/DatabaseServiceProvider.php | 2 ++ src/Database/Migration.php | 1 + 2 files changed, 3 insertions(+) diff --git a/src/Database/DatabaseServiceProvider.php b/src/Database/DatabaseServiceProvider.php index 3023052664..4256454534 100644 --- a/src/Database/DatabaseServiceProvider.php +++ b/src/Database/DatabaseServiceProvider.php @@ -25,6 +25,8 @@ public function register() $this->app->singleton('flarum.db', function () { $factory = new ConnectionFactory($this->app); + $dbConfig = $this->app->config('database'); + $dbConfig['engine'] = 'InnoDB'; $connection = $factory->make($this->app->config('database')); $connection->setEventDispatcher($this->app->make('Illuminate\Contracts\Events\Dispatcher')); diff --git a/src/Database/Migration.php b/src/Database/Migration.php index 6226bd9135..2109bd4297 100644 --- a/src/Database/Migration.php +++ b/src/Database/Migration.php @@ -31,6 +31,7 @@ public static function createTable($name, callable $definition) 'up' => function (Builder $schema) use ($name, $definition) { $schema->create($name, function (Blueprint $table) use ($schema, $definition) { $definition($table); + $table->engine = 'InnoDB'; static::fixIndexNames($schema, $table); });