card action
This commit is contained in:
@ -71,10 +71,15 @@ class MigrationController extends ConsoleController
|
||||
$dmr = new DatabaseMigrationRepository(App::$db->capsule->getDatabaseManager(), 'migration');
|
||||
|
||||
$m = new Migrator($dmr, App::$db->capsule->getDatabaseManager(), new Filesystem());
|
||||
if (\kernel\App::$db->schema->hasTable('option')) {
|
||||
$migrationPaths = array_merge($this->moduleService->getModulesMigrationsPaths(), [ROOT_DIR . '/migrations']);
|
||||
} else {
|
||||
$migrationPaths = [ROOT_DIR . '/migrations'];
|
||||
if (isset($this->argv['path'])){
|
||||
$migrationPaths = [ROOT_DIR . $this->argv['path']];
|
||||
}
|
||||
else {
|
||||
if (\kernel\App::$db->schema->hasTable('option')) {
|
||||
$migrationPaths = array_merge($this->moduleService->getModulesMigrationsPaths(), [ROOT_DIR . '/migrations']);
|
||||
} else {
|
||||
$migrationPaths = [ROOT_DIR . '/migrations'];
|
||||
}
|
||||
}
|
||||
|
||||
$res = $m->run($migrationPaths);
|
||||
@ -94,7 +99,13 @@ class MigrationController extends ConsoleController
|
||||
|
||||
$m = new Migrator($dmr, App::$db->capsule->getDatabaseManager(), new Filesystem());
|
||||
//$migrationPaths = array_merge(App::$migrationsPaths, [WORKSPACE_DIR . '/console/migrations']);
|
||||
$migrationPaths = [ROOT_DIR . '/migrations'];
|
||||
if (isset($this->argv['path'])){
|
||||
$migrationPaths = [ROOT_DIR . $this->argv['path']];
|
||||
}
|
||||
else {
|
||||
$migrationPaths = [ROOT_DIR . '/migrations'];
|
||||
}
|
||||
|
||||
$res = $m->rollback($migrationPaths, ['step' => $step]);
|
||||
print_r($step);
|
||||
foreach ($res as $re) {
|
||||
|
Reference in New Issue
Block a user