add vote infra and ui prep for connection ui to backend

This commit is contained in:
2024-12-01 23:43:52 -07:00
parent a1a112ed11
commit 091e55fc2f
11 changed files with 197 additions and 31 deletions

View File

@ -26,7 +26,8 @@ CREATE TABLE votes (
comment_id TEXT, -- NULL if vote is on webpage
voter TEXT NOT NULL,
vote_type TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE (voter, comment_id, webpage_id) -- ensure a user can only vote once per comment or webpage
);
-- make a table for storing users