Skip to content

Commit 534845d

Browse files
committed
fix: Fix to Create Migration with Defaults
1 parent b03aa91 commit 534845d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

webfiori/framework/cli/commands/CreateCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use webfiori\framework\cli\helpers\CreateDBAccessHelper;
2121
use webfiori\framework\cli\helpers\CreateFullRESTHelper;
2222
use webfiori\framework\cli\helpers\CreateMiddleware;
23+
use webfiori\framework\cli\helpers\CreateMigration;
2324
use webfiori\framework\cli\helpers\CreateTableObj;
2425
use webfiori\framework\cli\helpers\CreateThemeHelper;
2526
use webfiori\framework\cli\helpers\CreateWebService;
@@ -116,7 +117,7 @@ public function exec() : int {
116117
return -1;
117118
}
118119
} else if ($answer == 'Database migration.') {
119-
$create = new \webfiori\framework\cli\helpers\CreateMigration($this);
120+
$create = new CreateMigration($this);
120121
if ($create->isConfigured()) {
121122
$create->writeClass();
122123
$writer = $create->getWriter();

webfiori/framework/cli/helpers/CreateMigration.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ public function __construct(CreateCommand $command) {
4646
parent::__construct($command, new DatabaseMigrationWriter($runner));
4747
$this->writer = $this->getWriter();
4848
$this->setNamespace($ns);
49-
49+
50+
$this->isConfigured = true;
5051
if (!$command->isArgProvided('--defaults')) {
5152
$this->setClassName($command->readClassName('Provide an optional name for the class that will have migration logic:', null));
5253
$this->readClassInfo();
53-
$this->isConfigured = true;
54+
5455
}
5556
}
5657
}
@@ -71,8 +72,6 @@ private function initRunner($ns, $command) {
7172
} else {
7273
return null;
7374
}
74-
} else {
75-
return null;
7675
}
7776
return new MigrationsRunner($path, $ns, null);
7877
}

0 commit comments

Comments
 (0)