| @@ 240-254 (lines=15) @@ | ||
| 237 | /** @var Migration $migration */ |
|
| 238 | $migration = $migrationService->getMigration($migrationDefinition->name); |
|
| 239 | ||
| 240 | if (!$migration) { |
|
| 241 | // q: shall we add the migration to the db as failed? In doubt, we let it become a ghost, disappeared without a trace... |
|
| 242 | throw new \Exception("After the separate process charged to execute the migration finished, the migration can not be found in the database any more."); |
|
| 243 | } else if ($migration->status == Migration::STATUS_STARTED) { |
|
| 244 | $errorMsg = "The separate process charged to execute the migration left it in 'started' state. Most likely it died halfway through execution."; |
|
| 245 | $migrationService->endMigration(New Migration( |
|
| 246 | $migration->name, |
|
| 247 | $migration->md5, |
|
| 248 | $migration->path, |
|
| 249 | $migration->executionDate, |
|
| 250 | Migration::STATUS_FAILED, |
|
| 251 | ($migration->executionError != '' ? ($errorMsg . ' ' . $migration->executionError) : $errorMsg) |
|
| 252 | )); |
|
| 253 | throw new \Exception($errorMsg); |
|
| 254 | } |
|
| 255 | ||
| 256 | $executed++; |
|
| 257 | ||
| @@ 175-189 (lines=15) @@ | ||
| 172 | /** @var Migration $migration */ |
|
| 173 | $migration = $migrationService->getMigration($migrationDefinition->name); |
|
| 174 | ||
| 175 | if (!$migration) { |
|
| 176 | // q: shall we add the migration to the db as failed? In doubt, we let it become a ghost, disappeared without a trace... |
|
| 177 | throw new \Exception("After the separate process charged to execute the migration finished, the migration can not be found in the database any more."); |
|
| 178 | } else if ($migration->status == Migration::STATUS_STARTED) { |
|
| 179 | $errorMsg = "The separate process charged to execute the migration left it in 'started' state. Most likely it died halfway through execution."; |
|
| 180 | $migrationService->endMigration(New Migration( |
|
| 181 | $migration->name, |
|
| 182 | $migration->md5, |
|
| 183 | $migration->path, |
|
| 184 | $migration->executionDate, |
|
| 185 | Migration::STATUS_FAILED, |
|
| 186 | ($migration->executionError != '' ? ($errorMsg . ' ' . $migration->executionError) : $errorMsg) |
|
| 187 | )); |
|
| 188 | throw new \Exception($errorMsg); |
|
| 189 | } |
|
| 190 | ||
| 191 | $executed++; |
|
| 192 | ||