Skip to content

Commit cc94667

Browse files
authored
Merge pull request #4684 from nextcloud/enh/prepare-vote-changes
Add attributes to Option
2 parents 0ba5035 + 0270b00 commit cc94667

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

lib/Db/Option.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
* @method void setReleased(int $value)
3333
* @method int getDeleted()
3434
* @method void setDeleted(int $value)
35+
* @method int getCreated()
36+
* @method void setCreated(int $value)
37+
* @method ?string getDescription()
38+
* @method void setDescription(?string $value)
39+
*
3540
*
3641
* No magic getters, getters are overwritten for special handling of timestamp and option text
3742
* @method void setOrder(int $value)
@@ -70,6 +75,7 @@ class Option extends EntityWithUser implements JsonSerializable {
7075
protected int $pollId = 0;
7176
protected string $pollOptionText = '';
7277
protected string $pollOptionHash = '';
78+
protected ?string $description = '';
7379
protected int $timestamp = 0;
7480
protected int $duration = 0;
7581
protected int $order = 0;
@@ -79,6 +85,7 @@ class Option extends EntityWithUser implements JsonSerializable {
7985
protected string $owner = '';
8086
protected int $released = 0;
8187
protected int $deleted = 0;
88+
protected int $created = 0;
8289

8390
// joined columns
8491
protected ?string $userVoteAnswer = '';
@@ -104,6 +111,7 @@ public function __construct() {
104111
$this->addType('duration', 'integer');
105112
$this->addType('confirmed', 'integer');
106113
$this->addType('deleted', 'integer');
114+
$this->addType('created', 'integer');
107115

108116
// joined Attributes
109117
$this->addType('optionLimit', 'integer');

lib/Migration/V9/TableSchema.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ abstract class TableSchema {
272272
'owner' => ['type' => Types::STRING, 'options' => ['notnull' => true, 'default' => '', 'length' => 256]],
273273
'released' => ['type' => Types::BIGINT, 'options' => ['notnull' => true, 'default' => 0, 'length' => 20]],
274274
'deleted' => ['type' => Types::BIGINT, 'options' => ['notnull' => true, 'default' => 0, 'length' => 20]],
275+
'description' => ['type' => Types::TEXT, 'options' => ['notnull' => false, 'default' => null, 'length' => 65535]],
276+
'created' => ['type' => Types::BIGINT, 'options' => ['notnull' => true, 'default' => 0, 'length' => 20]],
275277
],
276278
Vote::TABLE => [
277279
'id' => ['type' => Types::BIGINT, 'options' => ['autoincrement' => true, 'notnull' => true, 'length' => 20]],

0 commit comments

Comments
 (0)