Removed the concept of down & upvotes
This commit is contained in:
parent
84defa703e
commit
2e23c7919f
11 changed files with 58 additions and 120 deletions
|
@ -2,8 +2,6 @@ CREATE TABLE IF NOT EXISTS posts (
|
|||
id BIGSERIAL PRIMARY KEY,
|
||||
user_id BIGINT NOT NULL,
|
||||
content TEXT NOT NULL,
|
||||
upvotes INTEGER NOT NULL DEFAULT 0,
|
||||
downvotes INTEGER NOT NULL DEFAULT 0,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (user_id) REFERENCES users (id)
|
||||
|
|
|
@ -4,8 +4,6 @@ CREATE TABLE IF NOT EXISTS comments (
|
|||
-- parent_comment_id BIGINT,
|
||||
author_user_id BIGINT NOT NULL,
|
||||
content TEXT NOT NULL,
|
||||
upvotes INTEGER NOT NULL DEFAULT 0,
|
||||
downvotes INTEGER NOT NULL DEFAULT 0,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (parent_post_id) REFERENCES posts (id),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue