1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 23:44:27 +02:00

Improve install command, add custom migrations system

Implemented our own migration repository + migrator (based on Laravel's
stuff) so that we can keep track of which migrations have been run for
core and per-extension. That way we can simple call the migrator to
upgrade core/extensions, and to uninstall extensions.
This commit is contained in:
Toby Zerner
2015-08-14 12:47:59 +09:30
parent 5228628a71
commit 2edcbacccc
28 changed files with 822 additions and 193 deletions

View File

@@ -6,6 +6,7 @@ use Illuminate\Database\ConnectionResolver;
use Illuminate\Database\Connectors\ConnectionFactory;
use Illuminate\Database\Eloquent\Model;
use PDO;
use Flarum\Migrations\DatabaseMigrationRepository;
class DatabaseServiceProvider extends ServiceProvider
{
@@ -44,5 +45,10 @@ class DatabaseServiceProvider extends ServiceProvider
Model::setEventDispatcher($this->app->make('events'));
});
}
$this->app->singleton('Flarum\Migrations\MigrationRepositoryInterface', function ($app) {
return new DatabaseMigrationRepository($app['db'], 'migrations');
});
}
}