@@ -176,10 +176,10 @@ discard block |
||
| 176 | 176 | $tableName = $this->config->get('migration.table', 'migrations'); |
| 177 | 177 | $this->schema->create($tableName, function (CreateTable $table) { |
| 178 | 178 | $table->string('version', 20) |
| 179 | - ->description('The migration version') |
|
| 180 | - ->primary(); |
|
| 179 | + ->description('The migration version') |
|
| 180 | + ->primary(); |
|
| 181 | 181 | $table->string('description') |
| 182 | - ->description('The migration description'); |
|
| 182 | + ->description('The migration description'); |
|
| 183 | 183 | $table->datetime('created_at') |
| 184 | 184 | ->description('Migration run time'); |
| 185 | 185 | |
@@ -264,9 +264,9 @@ discard block |
||
| 264 | 264 | $this->checkMigrationTable(); |
| 265 | 265 | |
| 266 | 266 | $migrations = $this->repository |
| 267 | - ->query() |
|
| 268 | - ->orderBy('version') |
|
| 269 | - ->all(); |
|
| 267 | + ->query() |
|
| 268 | + ->orderBy('version') |
|
| 269 | + ->all(); |
|
| 270 | 270 | $result = []; |
| 271 | 271 | |
| 272 | 272 | foreach ($migrations as $entity) { |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | ) { |
| 83 | 83 | parent::__construct($app, $repository, $schema, $config, $filesystem); |
| 84 | 84 | $this->setName('migration:create') |
| 85 | - ->setDescription('Create a new migration'); |
|
| 85 | + ->setDescription('Create a new migration'); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | /** |
@@ -159,26 +159,3 @@ discard block |
||
| 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 | -} |
|
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | ) { |
| 74 | 74 | parent::__construct($app, $repository, $schema, $config, $filesystem); |
| 75 | 75 | $this->setName('migration:migrate') |
| 76 | - ->setDescription('Upgrade to latest migration'); |
|
| 76 | + ->setDescription('Upgrade to latest migration'); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | ) { |
| 75 | 75 | parent::__construct($app, $repository, $schema, $config, $filesystem); |
| 76 | 76 | $this->setName('migration:status') |
| 77 | - ->setDescription('Show current status of your migrations'); |
|
| 77 | + ->setDescription('Show current status of your migrations'); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | ) { |
| 75 | 75 | parent::__construct($app, $repository, $schema, $config, $filesystem); |
| 76 | 76 | $this->setName('migration:exec') |
| 77 | - ->setDescription('Upgrade the migration up/down for the given version'); |
|
| 77 | + ->setDescription('Upgrade the migration up/down for the given version'); |
|
| 78 | 78 | |
| 79 | 79 | $this->addArgument('migration version', 'Version to execute', '', true); |
| 80 | 80 | $this->addArgument('type', 'type of migration [up|down]', 'up', true, true, false, function ($val) { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | )); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - return $val; |
|
| 88 | + return $val; |
|
| 89 | 89 | }); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -8,13 +8,13 @@ |
||
| 8 | 8 | |
| 9 | 9 | public function up(): void |
| 10 | 10 | { |
| 11 | - //Action when migrate up |
|
| 11 | + //Action when migrate up |
|
| 12 | 12 | |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | public function down(): void |
| 16 | 16 | { |
| 17 | - //Action when migrate down |
|
| 17 | + //Action when migrate down |
|
| 18 | 18 | |
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | \ No newline at end of file |
@@ -7,20 +7,20 @@ |
||
| 7 | 7 | class AddRoleCode20210704170839 extends AbstractMigration |
| 8 | 8 | { |
| 9 | 9 | |
| 10 | - public function up(): void |
|
| 11 | - { |
|
| 10 | + public function up(): void |
|
| 11 | + { |
|
| 12 | 12 | //Action when migrate up |
| 13 | 13 | $this->alter('roles', function (AlterTable $table) { |
| 14 | 14 | $table->string('code')->notNull(); |
| 15 | 15 | $table->unique('code'); |
| 16 | 16 | }); |
| 17 | - } |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - public function down(): void |
|
| 20 | - { |
|
| 19 | + public function down(): void |
|
| 20 | + { |
|
| 21 | 21 | //Action when migrate down |
| 22 | 22 | $this->alter('roles', function (AlterTable $table) { |
| 23 | 23 | $table->dropColumn('code'); |
| 24 | 24 | }); |
| 25 | - } |
|
| 25 | + } |
|
| 26 | 26 | } |
| 27 | 27 | \ No newline at end of file |
@@ -7,15 +7,15 @@ discard block |
||
| 7 | 7 | class AddRolesTable20210704165744 extends AbstractMigration |
| 8 | 8 | { |
| 9 | 9 | |
| 10 | - public function up(): void |
|
| 11 | - { |
|
| 10 | + public function up(): void |
|
| 11 | + { |
|
| 12 | 12 | //Action when migrate up |
| 13 | 13 | $this->create('roles', function (CreateTable $table) { |
| 14 | 14 | $table->integer('id') |
| 15 | 15 | ->autoincrement() |
| 16 | - ->primary(); |
|
| 16 | + ->primary(); |
|
| 17 | 17 | $table->string('description') |
| 18 | - ->description('The role description'); |
|
| 18 | + ->description('The role description'); |
|
| 19 | 19 | $table->datetime('created_at') |
| 20 | 20 | ->description('role created at') |
| 21 | 21 | ->notNull(); |
@@ -24,11 +24,11 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | $table->engine('INNODB'); |
| 26 | 26 | }); |
| 27 | - } |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - public function down(): void |
|
| 30 | - { |
|
| 29 | + public function down(): void |
|
| 30 | + { |
|
| 31 | 31 | //Action when migrate down |
| 32 | 32 | $this->drop('roles'); |
| 33 | - } |
|
| 33 | + } |
|
| 34 | 34 | } |
| 35 | 35 | \ No newline at end of file |