[ENTITY][Note] A note may have no content

This commit is contained in:
Diogo Peralta Cordeiro 2021-09-20 17:06:21 +01:00
parent b7298eaa44
commit 8bb6285522
Signed by: diogo
GPG Key ID: 18D2D35001FBFAB0

View File

@ -44,9 +44,9 @@ class Note extends Entity
// @codeCoverageIgnoreStart
private int $id;
private int $actor_id;
private string $content_type = 'text/plain';
private string $content;
private string $rendered;
private ?string $content_type = null;
private ?string $content = null;
private ?string $rendered = null;
private ?int $reply_to;
private ?bool $is_local;
private ?string $source;
@ -312,8 +312,8 @@ class Note extends Entity
'fields' => [
'id' => ['type' => 'serial', 'not null' => true],
'actor_id' => ['type' => 'int', 'foreign key' => true, 'target' => 'Actor.id', 'multiplicity' => 'one to one', 'not null' => true, 'description' => 'who made the note'],
'content' => ['type' => 'text', 'not null' => true, 'description' => 'note content'],
'content_type' => ['type' => 'varchar', 'not null' => true, 'default' => 'text/plain', 'length' => 129, 'description' => 'A note can be written in a multitude of formats such as text/plain, text/markdown, application/x-latex, and text/html'],
'content' => ['type' => 'text', 'description' => 'note content'],
'content_type' => ['type' => 'varchar', 'default' => 'text/plain', 'length' => 129, 'description' => 'A note can be written in a multitude of formats such as text/plain, text/markdown, application/x-latex, and text/html'],
'rendered' => ['type' => 'text', 'description' => 'rendered note content, so we can keep the microtags (if not local)'],
'reply_to' => ['type' => 'int', 'foreign key' => true, 'target' => 'Note.id', 'multiplicity' => 'one to one', 'description' => 'note replied to, null if root of a conversation'],
'is_local' => ['type' => 'bool', 'description' => 'was this note generated by a local actor'],