feat: attention & redis & async
This commit is contained in:
@@ -6,7 +6,8 @@ CREATE TABLE posts (
|
||||
content TEXT NOT NULL,
|
||||
cw VARCHAR NOT NULL DEFAULT '',
|
||||
author_title VARCHAR NOT NULL DEFAULT '',
|
||||
n_likes INTEGER NOT NULL DEFAULT 0,
|
||||
is_tmp BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
n_attentions INTEGER NOT NULL DEFAULT 0,
|
||||
n_comments INTEGER NOT NULL DEFAULT 0,
|
||||
create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
last_comment_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
@@ -4,11 +4,12 @@ CREATE TABLE comments (
|
||||
id INTEGER NOT NULL PRIMARY KEY,
|
||||
author_hash VARCHAR NOT NULL,
|
||||
author_title VARCHAR(10) NOT NULL DEFAULT '',
|
||||
is_tmp BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
content TEXT NOT NULL,
|
||||
create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
is_deleted BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
post_id INTEGER NOT NULL,
|
||||
FOREIGN KEY(post_id) REFERENCES post(id)
|
||||
FOREIGN KEY(post_id) REFERENCES posts(id)
|
||||
);
|
||||
CREATE INDEX comments_postId_idx ON comments (`post_id`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user