From 03db2b4cc0d266f371cf0099b41d9ce36e17fd8e Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Wed, 10 Feb 2016 14:07:29 +0100 Subject: [PATCH] Installer: Fix models not being ready for use when running migrations This was a regression after the recent introduction of a new migration that actually uses models. Maybe we should change this. See https://discuss.flarum.org/d/2023-can-t-manage-to-install-the-development-version-503-service-unavailable/8 --- framework/core/src/Install/Console/InstallCommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/framework/core/src/Install/Console/InstallCommand.php b/framework/core/src/Install/Console/InstallCommand.php index 99721d91e..68802d22c 100644 --- a/framework/core/src/Install/Console/InstallCommand.php +++ b/framework/core/src/Install/Console/InstallCommand.php @@ -161,16 +161,16 @@ class InstallCommand extends AbstractCommand $this->storeConfiguration(); + $resolver = $this->application->make('Illuminate\Database\ConnectionResolverInterface'); + AbstractModel::setConnectionResolver($resolver); + AbstractModel::setEventDispatcher($this->application->make('events')); + $this->runMigrations(); $this->writeSettings(); $this->application->register('Flarum\Core\CoreServiceProvider'); - $resolver = $this->application->make('Illuminate\Database\ConnectionResolverInterface'); - AbstractModel::setConnectionResolver($resolver); - AbstractModel::setEventDispatcher($this->application->make('events')); - $this->seedGroups(); $this->seedPermissions();