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

@@ -145,6 +145,7 @@ CREATE TABLE webhook (
CREATE INDEX idx_webhook_creator_id ON webhook (creator_id);
-- reaction
CREATE TABLE reaction (
id INTEGER PRIMARY KEY AUTOINCREMENT,
created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),

View File

@@ -0,0 +1,9 @@
-- reaction
CREATE TABLE reaction (
id INTEGER PRIMARY KEY AUTOINCREMENT,
created_ts BIGINT NOT NULL DEFAULT (strftime('%s', '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

@@ -144,3 +144,13 @@ CREATE TABLE webhook (
);
CREATE INDEX idx_webhook_creator_id ON webhook (creator_id);
-- reaction
CREATE TABLE reaction (
id INTEGER PRIMARY KEY AUTOINCREMENT,
created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),
creator_id INTEGER NOT NULL,
content_id TEXT NOT NULL,
reaction_type TEXT NOT NULL,
UNIQUE(creator_id, content_id, reaction_type)
);