Skip to content

Commit

Permalink
Merge pull request #81 from phalcon/fix/#80-configs
Browse files Browse the repository at this point in the history
#80 - Added possibility to pass some options via config
  • Loading branch information
Jeckerson authored Mar 26, 2020
2 parents 3beaea8 + 0636b1b commit 7b50f90
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 68 deletions.
100 changes: 50 additions & 50 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions src/Console/Commands/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public function run(): void
$migrationsDir = explode(',', $config['application']['migrationsDir']);
}


if (!empty($migrationsDir)) {
foreach ($migrationsDir as $id => $dir) {
if (!$this->isAbsolutePath($dir)) {
Expand All @@ -122,6 +121,10 @@ public function run(): void
*/
$migrationsTsBased = $config['application']['migrationsTsBased'] ?? $this->parser->has('ts-based');

$noAutoIncrement = $config['application']['no-auto-increment'] ?? $this->parser->has('no-auto-increment');
$skipRefSchema = $config['application']['skip-ref-schema'] ?? $this->parser->has('skip-ref-schema');
$skipForeignChecks = $config['application']['skip-foreign-checks'] ?? $this->parser->has('skip-foreign-checks');

$descr = $config['application']['descr'] ?? $this->parser->get('descr');
$tableName = $this->parser->get('table', '@');

Expand All @@ -135,11 +138,11 @@ public function run(): void
'migrationsDir' => $migrationsDir,
'version' => $this->parser->get('version'),
'force' => $this->parser->has('force'),
'noAutoIncrement' => $this->parser->has('no-auto-increment'),
'noAutoIncrement' => $noAutoIncrement,
'config' => $config,
'descr' => $descr,
'verbose' => $this->parser->has('dry'),
'skip-ref-schema' => $this->parser->has('skip-ref-schema'),
'skip-ref-schema' => $skipRefSchema,
]);
break;
case 'run':
Expand All @@ -153,7 +156,7 @@ public function run(): void
'version' => $this->parser->get('version'),
'migrationsInDb' => $migrationsInDb,
'verbose' => $this->parser->has('verbose'),
'skip-foreign-checks' => $this->parser->has('skip-foreign-checks'),
'skip-foreign-checks' => $skipForeignChecks,
]);
break;
case 'list':
Expand Down
Loading

0 comments on commit 7b50f90

Please sign in to comment.