add: reactions

This commit is contained in:
trisua 2025-03-24 22:42:33 -04:00
parent c46eb3b807
commit 382e3bc7a6
18 changed files with 357 additions and 11 deletions

View file

@ -2,3 +2,4 @@ pub const CREATE_TABLE_USERS: &str = include_str!("./sql/create_users.sql");
pub const CREATE_TABLE_PAGES: &str = include_str!("./sql/create_pages.sql");
pub const CREATE_TABLE_ENTRIES: &str = include_str!("./sql/create_entries.sql");
pub const CREATE_TABLE_MEMBERSHIPS: &str = include_str!("./sql/create_memberships.sql");
pub const CREATE_TABLE_REACTIONS: &str = include_str!("./sql/create_reactions.sql");

View file

@ -4,5 +4,8 @@ CREATE TABLE IF NOT EXISTS entries (
content TEXT NOT NULL,
owner INTEGER NOT NULL,
journal INTEGER NOT NULL,
context TEXT NOT NULL
context TEXT NOT NULL,
-- likes
likes INTEGER NOT NULL,
dislikes INTEGER NOT NULL
)

View file

@ -5,5 +5,8 @@ CREATE TABLE IF NOT EXISTS pages (
prompt TEXT NOT NULL,
owner INTEGER NOT NULL,
read_access TEXT NOT NULL,
write_access TEXT NOT NULL
write_access TEXT NOT NULL,
-- likes
likes INTEGER NOT NULL,
dislikes INTEGER NOT NULL
)

View file

@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS reactions (
id INTEGER NOT NULL PRIMARY KEY,
created INTEGER NOT NULL,
owner INTEGER NOT NULL,
asset INTEGER NOT NULL,
asset_type TEXT NOT NULL
)