[DB] Add rendered collumn to note table, so we can preserve microtags from other services

This commit is contained in:
Hugo Sales 2020-09-05 20:46:37 +00:00 committed by Hugo Sales
parent 460cbbd4c9
commit 7af424b64a
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -45,6 +45,7 @@ class Note extends Entity
private int $id;
private int $gsactor_id;
private ?string $content;
private ?string $rendered;
private ?int $reply_to;
private ?bool $is_local;
private ?string $source;
@ -87,6 +88,17 @@ class Note extends Entity
return $this->content;
}
public function setRendered(?string $rendered): self
{
$this->rendered = $rendered;
return $this;
}
public function getRendered(): ?string
{
return $this->rendered;
}
public function setReplyTo(?int $reply_to): self
{
$this->reply_to = $reply_to;
@ -214,6 +226,7 @@ class Note extends Entity
'id' => ['type' => 'serial', 'not null' => true],
'gsactor_id' => ['type' => 'int', 'not null' => true, 'description' => 'who made the note'],
'content' => ['type' => 'text', 'description' => 'note content'],
'rendered' => ['type' => 'text', 'description' => 'rendered note content if not local, so we can keep the microtags'],
'reply_to' => ['type' => 'int', 'description' => 'note replied to, null if root of a conversation'],
'is_local' => ['type' => 'bool', 'description' => 'was this note generated by a local actor'],
'source' => ['type' => 'varchar', 'length' => 32, 'description' => 'source of note, like "web", "im", or "clientname"'],