Skip to content

Commit

Permalink
Merge pull request #45 from phalcon/fix/#39-descr-config-key
Browse files Browse the repository at this point in the history
#39 - Add condition to check from config file
  • Loading branch information
Jeckerson authored Feb 2, 2020
2 parents 42879b4 + 34b5851 commit a20ec58
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Console/Commands/Builtin/Migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function run(array $parameters): void
$config = $this->getConfig($path);
}

$exportDataFromTables= [];
$exportDataFromTables = [];
if ($this->isReceivedOption('exportDataFromTables')) {
$exportDataFromTables = explode(',', $this->getOption('exportDataFromTables'));
} elseif (isset($config['application']['exportDataFromTables'])) {
Expand Down Expand Up @@ -129,6 +129,12 @@ public function run(array $parameters): void
$tableName = $this->isReceivedOption('table') ? $this->getOption('table') : '@';
$action = $this->getOption(['action', 1]);

if (isset($config['application']['descr'])) {
$descr = $config['application']['descr'];
} else {
$descr = $this->getOption('descr');
}

switch ($action) {
case 'generate':
Migrations::generate([
Expand All @@ -141,7 +147,7 @@ public function run(array $parameters): void
'force' => $this->isReceivedOption('force'),
'noAutoIncrement' => $this->isReceivedOption('no-auto-increment'),
'config' => $config,
'descr' => $this->getOption('descr'),
'descr' => $descr,
'verbose' => $this->isReceivedOption('dry'),
]);
break;
Expand Down

0 comments on commit a20ec58

Please sign in to comment.