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:
@@ -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');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user