diff --git a/lib/Db/Card.php b/lib/Db/Card.php index fe91387ae..7f66a4577 100644 --- a/lib/Db/Card.php +++ b/lib/Db/Card.php @@ -47,6 +47,12 @@ class Card extends RelationalEntity { protected $notified = false; protected $deletedAt = 0; protected $commentsUnread = 0; + protected $timeToComplete; + protected $timeToCompleteMinutes; + protected $milestone; + protected $product; + protected $component; + protected $pctComplete; private $databaseType = 'sqlite'; @@ -64,6 +70,8 @@ public function __construct() { $this->addType('archived', 'boolean'); $this->addType('notified', 'boolean'); $this->addType('deletedAt', 'integer'); + $this->addType('timeToCompleteMinutes', 'integer'); + $this->addType('pctComplete', 'integer'); $this->addRelation('labels'); $this->addRelation('assignedUsers'); $this->addRelation('attachments'); diff --git a/lib/Migration/Version1000Date20201112173419.php b/lib/Migration/Version1000Date20201112173419.php new file mode 100644 index 000000000..9d9d1fd3e --- /dev/null +++ b/lib/Migration/Version1000Date20201112173419.php @@ -0,0 +1,64 @@ +getTable('deck_cards'); + + $table->addColumn('time_to_complete', 'text', [ + 'notnull' => false, + ]); + $table->addColumn('time_to_complete_minutes', 'integer', [ + 'notnull' => false, + ]); + $table->addColumn('milestone', 'text', [ + 'notnull' => false, + ]); + $table->addColumn('product', 'text', [ + 'notnull' => false, + ]); + $table->addColumn('component', 'text', [ + 'notnull' => false, + ]); + $table->addColumn('pct_complete', 'integer', [ + 'notnull' => false, + ]); + + return $schema; + } + + /** + * @param IOutput $output + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` + * @param array $options + */ + public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { + } +} diff --git a/tests/unit/Db/CardTest.php b/tests/unit/Db/CardTest.php index 01f638a07..82fde28fc 100644 --- a/tests/unit/Db/CardTest.php +++ b/tests/unit/Db/CardTest.php @@ -85,6 +85,12 @@ public function testJsonSerialize() { 'commentsUnread' => 0, 'lastEditor' => null, 'ETag' => $card->getETag(), + 'pctComplete' => null, + 'timeToComplete' => null, + 'timeToCompleteMinutes' => null, + 'product' => null, + 'component' => null, + 'milestone' => null, ], $card->jsonSerialize()); } public function testJsonSerializeLabels() { @@ -111,6 +117,12 @@ public function testJsonSerializeLabels() { 'commentsUnread' => 0, 'lastEditor' => null, 'ETag' => $card->getETag(), + 'pctComplete' => null, + 'timeToComplete' => null, + 'timeToCompleteMinutes' => null, + 'product' => null, + 'component' => null, + 'milestone' => null, ], $card->jsonSerialize()); } @@ -147,6 +159,12 @@ public function testJsonSerializeAsignedUsers() { 'commentsUnread' => 0, 'lastEditor' => null, 'ETag' => $card->getETag(), + 'pctComplete' => null, + 'timeToComplete' => null, + 'timeToCompleteMinutes' => null, + 'product' => null, + 'component' => null, + 'milestone' => null, ], $card->jsonSerialize()); } }