@@ -174,7 +174,7 @@ |
||
| 174 | 174 | protected function createMigrationTable(): void |
| 175 | 175 | { |
| 176 | 176 | $tableName = $this->config->get('migration.table', 'migrations'); |
| 177 | - $this->schema->create($tableName, function (CreateTable $table) { |
|
| 177 | + $this->schema->create($tableName, function(CreateTable $table) { |
|
| 178 | 178 | $table->string('version', 20) |
| 179 | 179 | ->description('The migration version') |
| 180 | 180 | ->primary(); |
@@ -159,26 +159,3 @@ |
||
| 159 | 159 | private function getTemplateClass(): string |
| 160 | 160 | { |
| 161 | 161 | return <<<EOF |
| 162 | - <?php |
|
| 163 | - namespace Platine\Framework\Migration; |
|
| 164 | - |
|
| 165 | - use Platine\Framework\Migration\AbstractMigration; |
|
| 166 | - |
|
| 167 | - class %classname% extends AbstractMigration |
|
| 168 | - { |
|
| 169 | - |
|
| 170 | - public function up(): void |
|
| 171 | - { |
|
| 172 | - //Action when migrate up |
|
| 173 | - |
|
| 174 | - } |
|
| 175 | - |
|
| 176 | - public function down(): void |
|
| 177 | - { |
|
| 178 | - //Action when migrate down |
|
| 179 | - |
|
| 180 | - } |
|
| 181 | - } |
|
| 182 | - EOF; |
|
| 183 | - } |
|
| 184 | -} |
|
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | ->setDescription('Upgrade the migration up/down for the given version'); |
| 78 | 78 | |
| 79 | 79 | $this->addArgument('migration version', 'Version to execute', '', true); |
| 80 | - $this->addArgument('type', 'type of migration [up|down]', 'up', true, true, false, function ($val) { |
|
| 80 | + $this->addArgument('type', 'type of migration [up|down]', 'up', true, true, false, function($val) { |
|
| 81 | 81 | if (!in_array($val, ['up', 'down'])) { |
| 82 | 82 | throw new RuntimeException(sprintf( |
| 83 | 83 | 'Invalid argument type [%s], must be one of [up, down]', |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | public function up(): void |
| 11 | 11 | { |
| 12 | 12 | //Action when migrate up |
| 13 | - $this->alter('roles', function (AlterTable $table) { |
|
| 13 | + $this->alter('roles', function(AlterTable $table) { |
|
| 14 | 14 | $table->string('code')->notNull(); |
| 15 | 15 | $table->unique('code'); |
| 16 | 16 | }); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | public function down(): void |
| 20 | 20 | { |
| 21 | 21 | //Action when migrate down |
| 22 | - $this->alter('roles', function (AlterTable $table) { |
|
| 22 | + $this->alter('roles', function(AlterTable $table) { |
|
| 23 | 23 | $table->dropColumn('code'); |
| 24 | 24 | }); |
| 25 | 25 | } |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | public function up(): void |
| 11 | 11 | { |
| 12 | 12 | //Action when migrate up |
| 13 | - $this->create('roles', function (CreateTable $table) { |
|
| 13 | + $this->create('roles', function(CreateTable $table) { |
|
| 14 | 14 | $table->integer('id') |
| 15 | 15 | ->autoincrement() |
| 16 | 16 | ->primary(); |