[ENTITY] Add field size to attachments, used for quota calculations

This commit is contained in:
2021-04-29 20:29:21 +00:00
parent 29457ef50d
commit 7509913fcf
2 changed files with 15 additions and 1 deletions

View File

@@ -54,6 +54,7 @@ class Attachment extends Entity
private ?bool $is_local;
private ?int $source;
private ?int $scope;
private ?int $size;
private \DateTimeInterface $modified;
public function setId(int $id): self
@@ -177,6 +178,17 @@ class Attachment extends Entity
return $this->scope;
}
public function setSize(?int $size): self
{
$this->size = $size;
return $this;
}
public function getSize(): ?int
{
return $this->size;
}
public function setModified(DateTimeInterface $modified): self
{
$this->modified = $modified;
@@ -259,6 +271,7 @@ class Attachment extends Entity
'is_local' => ['type' => 'bool', 'description' => 'whether the file is stored locally'],
'source' => ['type' => 'int', 'default' => null, 'description' => 'Source of the Attachment (upload, TFN, embed)'],
'scope' => ['type' => 'int', 'default' => null, 'description' => 'visibility scope for this attachment'],
'size' => ['type' => 'int', 'description' => 'size of resource when available'],
'modified' => ['type' => 'timestamp', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'],
],
'primary key' => ['id'],