[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 13fb9b4698
commit 5c4be9d29e

View File

@ -45,6 +45,7 @@ class Note extends Entity
private int $id; private int $id;
private int $gsactor_id; private int $gsactor_id;
private ?string $content; private ?string $content;
private ?string $rendered;
private ?int $reply_to; private ?int $reply_to;
private ?bool $is_local; private ?bool $is_local;
private ?string $source; private ?string $source;
@ -87,6 +88,17 @@ class Note extends Entity
return $this->content; 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 public function setReplyTo(?int $reply_to): self
{ {
$this->reply_to = $reply_to; $this->reply_to = $reply_to;
@ -214,6 +226,7 @@ class Note extends Entity
'id' => ['type' => 'serial', 'not null' => true], 'id' => ['type' => 'serial', 'not null' => true],
'gsactor_id' => ['type' => 'int', 'not null' => true, 'description' => 'who made the note'], 'gsactor_id' => ['type' => 'int', 'not null' => true, 'description' => 'who made the note'],
'content' => ['type' => 'text', 'description' => 'note content'], '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'], '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'], '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"'], 'source' => ['type' => 'varchar', 'length' => 32, 'description' => 'source of note, like "web", "im", or "clientname"'],