modules init/deactivate, modules migrations
This commit is contained in:
@ -13,10 +13,18 @@ use Illuminate\Database\Migrations\MigrationCreator;
|
||||
use Illuminate\Database\Migrations\Migrator;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Schema\Builder;
|
||||
use kernel\services\ModuleService;
|
||||
|
||||
|
||||
class MigrationController extends ConsoleController
|
||||
{
|
||||
protected ModuleService $moduleService;
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->moduleService = new ModuleService();
|
||||
}
|
||||
|
||||
//create migrations table
|
||||
public function actionCreateMigrationTable(): void
|
||||
{
|
||||
@ -63,8 +71,8 @@ class MigrationController extends ConsoleController
|
||||
$dmr = new DatabaseMigrationRepository(App::$db->capsule->getDatabaseManager(), 'migration');
|
||||
|
||||
$m = new Migrator($dmr, App::$db->capsule->getDatabaseManager(), new Filesystem());
|
||||
//$migrationPaths = array_merge(App::$migrationsPaths, [ROOT_DIR . '/migrations']);
|
||||
$migrationPaths = [ROOT_DIR . '/migrations'];
|
||||
$migrationPaths = array_merge($this->moduleService->getModulesMigrationsPaths(), [ROOT_DIR . '/migrations']);
|
||||
//$migrationPaths = [ROOT_DIR . '/migrations'];
|
||||
$res = $m->run($migrationPaths);
|
||||
foreach ($res as $re){
|
||||
$this->out->r(basename($re), 'green');
|
||||
|
Reference in New Issue
Block a user