a mini social media app for small communities
1module entity
2
3// Like stores like information for a post.
4pub struct Like {
5pub mut:
6 id int @[primary; sql: serial]
7 user_id int
8 post_id int
9 is_like bool
10}
11
12// LikeCache stores the total likes for a post.
13pub struct LikeCache {
14pub mut:
15 id int @[primary; sql: serial]
16 post_id int @[unique]
17 likes int
18}