@@ -73,7 +73,7 @@ |
||
73 | 73 | ) { |
74 | 74 | parent::__construct($app, $repository, $schema, $config, $filesystem); |
75 | 75 | $this->setName('migration:migrate') |
76 | - ->setDescription('Upgrade migration to latest'); |
|
76 | + ->setDescription('Upgrade migration to latest'); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -73,7 +73,7 @@ |
||
73 | 73 | ) { |
74 | 74 | parent::__construct($app, $repository, $schema, $config, $filesystem); |
75 | 75 | $this->setName('migration:reset') |
76 | - ->setDescription('Rollback all migration done before'); |
|
76 | + ->setDescription('Rollback all migration done before'); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -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 | |
@@ -261,9 +261,9 @@ discard block |
||
261 | 261 | $this->checkMigrationTable(); |
262 | 262 | |
263 | 263 | $migrations = $this->repository |
264 | - ->query() |
|
265 | - ->orderBy('version', $orderDir) |
|
266 | - ->all(); |
|
264 | + ->query() |
|
265 | + ->orderBy('version', $orderDir) |
|
266 | + ->all(); |
|
267 | 267 | $result = []; |
268 | 268 | |
269 | 269 | foreach ($migrations as $entity) { |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | protected function getMigrationClassName(string $description, string $version): string |
283 | 283 | { |
284 | 284 | return Str::camel($description, false) |
285 | - . Str::replaceFirst('_', '', $version); |
|
285 | + . Str::replaceFirst('_', '', $version); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | /** |
@@ -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('Execute the migration up/down for one version'); |
|
77 | + ->setDescription('Execute the migration up/down for one version'); |
|
78 | 78 | |
79 | 79 | $this->addArgument('type', 'type of migration [up|down]', 'up', true, true, false, function ($val) { |
80 | 80 | if (!in_array($val, ['up', 'down'])) { |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | )); |
85 | 85 | } |
86 | 86 | |
87 | - return $val; |
|
87 | + return $val; |
|
88 | 88 | }); |
89 | 89 | } |
90 | 90 |
@@ -9,26 +9,26 @@ |
||
9 | 9 | |
10 | 10 | public function up(): void |
11 | 11 | { |
12 | - //Action when migrate up |
|
13 | - $this->create('roles', function (CreateTable $table) { |
|
14 | - $table->integer('id') |
|
15 | - ->autoincrement() |
|
16 | - ->primary(); |
|
17 | - $table->string('description') |
|
18 | - ->description('The role description'); |
|
19 | - $table->datetime('created_at') |
|
20 | - ->description('role created at') |
|
21 | - ->notNull(); |
|
22 | - $table->datetime('updated_at') |
|
23 | - ->description('role updated at'); |
|
12 | + //Action when migrate up |
|
13 | + $this->create('roles', function (CreateTable $table) { |
|
14 | + $table->integer('id') |
|
15 | + ->autoincrement() |
|
16 | + ->primary(); |
|
17 | + $table->string('description') |
|
18 | + ->description('The role description'); |
|
19 | + $table->datetime('created_at') |
|
20 | + ->description('role created at') |
|
21 | + ->notNull(); |
|
22 | + $table->datetime('updated_at') |
|
23 | + ->description('role updated at'); |
|
24 | 24 | |
25 | - $table->engine('INNODB'); |
|
26 | - }); |
|
25 | + $table->engine('INNODB'); |
|
26 | + }); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function down(): void |
30 | 30 | { |
31 | - //Action when migrate down |
|
32 | - $this->drop('roles'); |
|
31 | + //Action when migrate down |
|
32 | + $this->drop('roles'); |
|
33 | 33 | } |
34 | 34 | } |
35 | 35 | \ No newline at end of file |
@@ -9,18 +9,18 @@ |
||
9 | 9 | |
10 | 10 | public function up(): void |
11 | 11 | { |
12 | - //Action when migrate up |
|
13 | - $this->alter('roles', function (AlterTable $table) { |
|
14 | - $table->string('code')->notNull(); |
|
15 | - $table->unique('code'); |
|
16 | - }); |
|
12 | + //Action when migrate up |
|
13 | + $this->alter('roles', function (AlterTable $table) { |
|
14 | + $table->string('code')->notNull(); |
|
15 | + $table->unique('code'); |
|
16 | + }); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | public function down(): void |
20 | 20 | { |
21 | - //Action when migrate down |
|
22 | - $this->alter('roles', function (AlterTable $table) { |
|
23 | - $table->dropColumn('code'); |
|
24 | - }); |
|
21 | + //Action when migrate down |
|
22 | + $this->alter('roles', function (AlterTable $table) { |
|
23 | + $table->dropColumn('code'); |
|
24 | + }); |
|
25 | 25 | } |
26 | 26 | } |
27 | 27 | \ No newline at end of file |