Rename created_at to started_at
[MAILPOET-4463]
This commit is contained in:
committed by
Jan Jakeš
parent
bf0f8a4dc5
commit
4687a8c515
@@ -22,7 +22,7 @@ class WorkflowRunLog {
|
|||||||
private $workflowRunId;
|
private $workflowRunId;
|
||||||
|
|
||||||
/** @var DateTimeImmutable */
|
/** @var DateTimeImmutable */
|
||||||
private $createdAt;
|
private $startedAt;
|
||||||
|
|
||||||
/** @var DateTimeImmutable|null */
|
/** @var DateTimeImmutable|null */
|
||||||
private $completedAt;
|
private $completedAt;
|
||||||
@@ -57,8 +57,7 @@ class WorkflowRunLog {
|
|||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$now = new DateTimeImmutable();
|
$this->startedAt = new DateTimeImmutable();
|
||||||
$this->createdAt = $now;
|
|
||||||
|
|
||||||
$this->error = [];
|
$this->error = [];
|
||||||
$this->data = [];
|
$this->data = [];
|
||||||
@@ -119,8 +118,8 @@ class WorkflowRunLog {
|
|||||||
$this->data[$key] = $value;
|
$this->data[$key] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCreatedAt(): DateTimeImmutable {
|
public function getStartedAt(): DateTimeImmutable {
|
||||||
return $this->createdAt;
|
return $this->startedAt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toArray(): array {
|
public function toArray(): array {
|
||||||
@@ -128,7 +127,7 @@ class WorkflowRunLog {
|
|||||||
'workflow_run_id' => $this->workflowRunId,
|
'workflow_run_id' => $this->workflowRunId,
|
||||||
'step_id' => $this->stepId,
|
'step_id' => $this->stepId,
|
||||||
'status' => $this->status,
|
'status' => $this->status,
|
||||||
'created_at' => $this->createdAt->format(DateTimeImmutable::W3C),
|
'started_at' => $this->startedAt->format(DateTimeImmutable::W3C),
|
||||||
'completed_at' => $this->completedAt ? $this->completedAt->format(DateTimeImmutable::W3C) : null,
|
'completed_at' => $this->completedAt ? $this->completedAt->format(DateTimeImmutable::W3C) : null,
|
||||||
'args' => Json::encode($this->args),
|
'args' => Json::encode($this->args),
|
||||||
'error' => Json::encode($this->error),
|
'error' => Json::encode($this->error),
|
||||||
@@ -164,7 +163,7 @@ class WorkflowRunLog {
|
|||||||
$workflowRunLog->error = Json::decode($data['error']);
|
$workflowRunLog->error = Json::decode($data['error']);
|
||||||
$workflowRunLog->data = Json::decode($data['data']);
|
$workflowRunLog->data = Json::decode($data['data']);
|
||||||
$workflowRunLog->args = Json::decode($data['args']);
|
$workflowRunLog->args = Json::decode($data['args']);
|
||||||
$workflowRunLog->createdAt = new DateTimeImmutable($data['created_at']);
|
$workflowRunLog->startedAt = new DateTimeImmutable($data['started_at']);
|
||||||
|
|
||||||
if ($data['completed_at']) {
|
if ($data['completed_at']) {
|
||||||
$workflowRunLog->completedAt = new DateTimeImmutable($data['completed_at']);
|
$workflowRunLog->completedAt = new DateTimeImmutable($data['completed_at']);
|
||||||
|
@@ -68,7 +68,7 @@ class Migrator {
|
|||||||
workflow_run_id int(11) unsigned NOT NULL,
|
workflow_run_id int(11) unsigned NOT NULL,
|
||||||
step_id varchar(255) NOT NULL,
|
step_id varchar(255) NOT NULL,
|
||||||
status varchar(255) NOT NULL,
|
status varchar(255) NOT NULL,
|
||||||
created_at timestamp NOT NULL,
|
started_at timestamp NOT NULL,
|
||||||
completed_at timestamp NULL DEFAULT NULL,
|
completed_at timestamp NULL DEFAULT NULL,
|
||||||
args longtext,
|
args longtext,
|
||||||
error longtext,
|
error longtext,
|
||||||
|
Reference in New Issue
Block a user