chore: tweak reaction store

This commit is contained in:
Steven
2024-02-09 21:59:45 +08:00
parent 81aa9b107f
commit 3dddd3ec4c
23 changed files with 210 additions and 67 deletions

View File

@ -131,3 +131,13 @@ CREATE TABLE webhook (
name TEXT NOT NULL,
url TEXT NOT NULL
);
-- reaction
CREATE TABLE reaction (
id SERIAL PRIMARY KEY,
created_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()),
creator_id INTEGER NOT NULL,
content_id TEXT NOT NULL,
reaction_type TEXT NOT NULL,
UNIQUE(creator_id, content_id, reaction_type)
);

View File

@ -0,0 +1,9 @@
-- reaction
CREATE TABLE reaction (
id SERIAL PRIMARY KEY,
created_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()),
creator_id INTEGER NOT NULL,
content_id TEXT NOT NULL,
reaction_type TEXT NOT NULL,
UNIQUE(creator_id, content_id, reaction_type)
);

View File

@ -131,3 +131,13 @@ CREATE TABLE webhook (
name TEXT NOT NULL,
url TEXT NOT NULL
);
-- reaction
CREATE TABLE reaction (
id SERIAL PRIMARY KEY,
created_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()),
creator_id INTEGER NOT NULL,
content_id TEXT NOT NULL,
reaction_type TEXT NOT NULL,
UNIQUE(creator_id, content_id, reaction_type)
);