Skip to content

Commit f7b2073

Browse files
committed
update AddCommand
change code generation of controller and migration templates
1 parent b599a08 commit f7b2073

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/Commands/AddCommand.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,10 @@ public static function createController(string $namespace, ?string $className, ?
159159
$context->appendLine();
160160
$context->appendLine("namespace {$namespace};");
161161
$context->appendLine();
162-
$context->appendLine('use DevNet\Web\Controller\ActionController;');
162+
$context->appendLine('use DevNet\Web\Controller\AbstractController;');
163163
$context->appendLine('use DevNet\Web\Controller\IActionResult;');
164164
$context->appendLine();
165-
$context->appendLine("class {$className} extends ActionController");
165+
$context->appendLine("class {$className} extends AbstractController");
166166
$context->appendLine('{');
167167
$context->appendLine(' public function index(): IActionResult');
168168
$context->appendLine(' {');
@@ -208,15 +208,10 @@ public static function createMigration(string $namespace, ?string $className, ?s
208208
$context->appendLine('{');
209209
$context->appendLine(' public function up(MigrationBuilder $builder): void');
210210
$context->appendLine(' {');
211-
$context->appendLine(' $builder->createTable(\'MyTable\', function ($table) {;');
212-
$context->appendLine(' $table->column(\'Id\')->type(\'integer\')->identity();');
213-
$context->appendLine(' $table->primaryKey(\'Id\');');
214-
$context->appendLine(' });');
215211
$context->appendLine(' }');
216212
$context->appendLine();
217213
$context->appendLine(' public function down(MigrationBuilder $builder): void');
218214
$context->appendLine(' {');
219-
$context->appendLine(' $builder->dropTable(\'MyTable\');');
220215
$context->appendLine(' }');
221216
$context->appendLine('}');
222217

0 commit comments

Comments
 (0)