diff options
author | Jonas Kohl | 2024-09-12 19:49:17 +0200 |
---|---|---|
committer | Jonas Kohl | 2024-09-12 19:49:17 +0200 |
commit | 086e2d2668784469ec114f6e6fd2b3dace3d7c3b (patch) | |
tree | b9bacedb713501d88d24085940267a7c94e69b29 /src/application/mystic/forum/orm/Post.php | |
parent | 34b1b391d4b03659a96f868857c230002b351514 (diff) |
Way more progress on forum
Diffstat (limited to 'src/application/mystic/forum/orm/Post.php')
-rw-r--r-- | src/application/mystic/forum/orm/Post.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/application/mystic/forum/orm/Post.php b/src/application/mystic/forum/orm/Post.php index 2c9a38c..becbb9d 100644 --- a/src/application/mystic/forum/orm/Post.php +++ b/src/application/mystic/forum/orm/Post.php @@ -3,6 +3,7 @@ declare(strict_types=1); namespace mystic\forum\orm; +use mystic\forum\attributes\DefaultValue; use mystic\forum\attributes\PrimaryKey; use mystic\forum\attributes\References; use mystic\forum\attributes\Table; @@ -11,7 +12,8 @@ use mystic\forum\attributes\Table; class Post extends Entity { #[PrimaryKey] public string $id; public string $content; - #[References("public.users")] public string $authorId; + #[References("public.users", onDelete: References::SET_NULL)] public ?string $authorId; public \DateTimeImmutable $postDate; - #[References("public.topics", cascadeOnDelete: true)] public string $topicId; + #[References("public.topics", onDelete: References::CASCADE)] public string $topicId; + #[DefaultValue("false")] public bool $deleted; } |