Skip to content

Commit

Permalink
Changed MakeMigrationCommand to use the CreateTableBlueprint class
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterZydra committed Apr 17, 2024
1 parent 6cde69f commit e18a182
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion framework/Database/Commands/MakeMigrationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@ public function execute(array $args): int
file_put_contents(
$path,
'<?php' . PHP_EOL . PHP_EOL .
'use Framework\Database\CreateTableBlueprint;' . PHP_EOL .
'use Framework\Database\Database;' . PHP_EOL .
'use Framework\Database\Migration\Migration;' . PHP_EOL . PHP_EOL .
'return new class extends Migration' . PHP_EOL .
'{' . PHP_EOL .
' public function run(): void' . PHP_EOL .
' {' . PHP_EOL .
' Database::unprepared(\'CREATE TABLE ...\');' . PHP_EOL .
' Database::executeBlueprint((new CreateTableBlueprint(\'tablename\'))' . PHP_EOL .
' ->id()' . PHP_EOL .
' ->string(\'column-name\', 255)' . PHP_EOL .
' ->timestamps()' . PHP_EOL .
' );' . PHP_EOL .
' }' . PHP_EOL .
'};' . PHP_EOL
);
Expand Down

0 comments on commit e18a182

Please sign in to comment.