feat: get comment & send post

This commit is contained in:
2022-03-16 00:46:55 +08:00
parent d9aec4d613
commit e373ac9ab6
10 changed files with 186 additions and 23 deletions

View File

@@ -0,0 +1,3 @@
-- This file should undo anything in `up.sql`
DROP TABLE comments

View File

@@ -0,0 +1,14 @@
-- Your SQL goes here
CREATE TABLE comments (
id INTEGER NOT NULL PRIMARY KEY,
author_hash VARCHAR NOT NULL,
author_title VARCHAR(10) NOT NULL DEFAULT '',
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)
);
CREATE INDEX comments_postId_idx ON comments (`post_id`);