|
@@ -154,12 +154,12 @@ discard block |
|
|
block discarded – undo |
|
154
|
154
|
|
|
155
|
155
|
if ($fullVersion) { |
|
156
|
156
|
[$major, $minor] = explode('.', $fullVersion); |
|
157
|
|
- $shouldVersion = (string) ((int)$major * 1000 + (int)$minor); |
|
|
157
|
+ $shouldVersion = (string) ((int) $major * 1000 + (int) $minor); |
|
158
|
158
|
if ($version !== $shouldVersion) { |
|
159
|
|
- $output->writeln('<comment>Unexpected migration version for current version: ' . $fullVersion . '</comment>'); |
|
|
159
|
+ $output->writeln('<comment>Unexpected migration version for current version: '.$fullVersion.'</comment>'); |
|
160
|
160
|
$output->writeln('<comment> - Pattern: XYYY </comment>'); |
|
161
|
|
- $output->writeln('<comment> - Expected: ' . $shouldVersion . '</comment>'); |
|
162
|
|
- $output->writeln('<comment> - Actual: ' . $version . '</comment>'); |
|
|
161
|
+ $output->writeln('<comment> - Expected: '.$shouldVersion.'</comment>'); |
|
|
162
|
+ $output->writeln('<comment> - Actual: '.$version.'</comment>'); |
|
163
|
163
|
|
|
164
|
164
|
if ($input->isInteractive()) { |
|
165
|
165
|
$helper = $this->getHelper('question'); |
|
@@ -175,7 +175,7 @@ discard block |
|
|
block discarded – undo |
|
175
|
175
|
$ms = new MigrationService($appName, $this->connection, new ConsoleOutput($output)); |
|
176
|
176
|
|
|
177
|
177
|
$date = date('YmdHis'); |
|
178
|
|
- $path = $this->generateMigration($ms, 'Version' . $version . 'Date' . $date); |
|
|
178
|
+ $path = $this->generateMigration($ms, 'Version'.$version.'Date'.$date); |
|
179
|
179
|
|
|
180
|
180
|
$output->writeln("New migration class has been generated to <info>$path</info>"); |
|
181
|
181
|
return 0; |
|
@@ -205,7 +205,7 @@ discard block |
|
|
block discarded – undo |
|
205
|
205
|
$appName = $context->getWordAtIndex($context->getWordIndex() - 1); |
|
206
|
206
|
|
|
207
|
207
|
$version = explode('.', $this->appManager->getAppVersion($appName)); |
|
208
|
|
- return [$version[0] . sprintf('%1$03d', $version[1])]; |
|
|
208
|
+ return [$version[0].sprintf('%1$03d', $version[1])]; |
|
209
|
209
|
} |
|
210
|
210
|
|
|
211
|
211
|
return []; |
|
@@ -219,7 +219,7 @@ discard block |
|
|
block discarded – undo |
|
219
|
219
|
*/ |
|
220
|
220
|
protected function generateMigration(MigrationService $ms, $className, $schemaBody = '') { |
|
221
|
221
|
if ($schemaBody === '') { |
|
222
|
|
- $schemaBody = "\t\t" . 'return null;'; |
|
|
222
|
+ $schemaBody = "\t\t".'return null;'; |
|
223
|
223
|
} |
|
224
|
224
|
|
|
225
|
225
|
|
|
@@ -239,7 +239,7 @@ discard block |
|
|
block discarded – undo |
|
239
|
239
|
$dir = $ms->getMigrationsDirectory(); |
|
240
|
240
|
|
|
241
|
241
|
$this->ensureMigrationDirExists($dir); |
|
242
|
|
- $path = $dir . '/' . $className . '.php'; |
|
|
242
|
+ $path = $dir.'/'.$className.'.php'; |
|
243
|
243
|
|
|
244
|
244
|
if (file_put_contents($path, $code) === false) { |
|
245
|
245
|
throw new RuntimeException('Failed to generate new migration step.'); |