Clear error when rerunning migration

[MAILPOET-4811]
This commit is contained in:
Jan Jakes
2022-11-14 17:02:25 +01:00
committed by Jan Jakeš
parent 764e1a1bf0
commit 70aefb421b
2 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,9 @@ class Store {
VALUES (?, current_timestamp())
ON DUPLICATE KEY UPDATE
started_at = current_timestamp(),
retries = retries + 1
completed_at = NULL,
retries = retries + 1,
error = NULL
", [$name]);
}

View File

@ -212,7 +212,7 @@ class MigratorTest extends MailPoetTest {
$this->assertStringMatchesFormat(self::DATE_TIME_FORMAT, $data['started_at']);
$this->assertStringMatchesFormat(self::DATE_TIME_FORMAT, $data['completed_at']);
$this->assertSame(1, (int)$data['retries']);
$this->assertSame('test-error', $data['error']);
$this->assertNull($data['error']);
}
public function testItFailsBrokenMigration(): void {