Removing everything to do with parent_comment_id in comment table for now
This commit is contained in:
parent
3d40ec513e
commit
32ff43e87c
1 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
CREATE TABLE IF NOT EXISTS comments (
|
CREATE TABLE IF NOT EXISTS comments (
|
||||||
id BIGSERIAL PRIMARY KEY,
|
id SERIAL PRIMARY KEY NOT NULL,
|
||||||
parent_post_id BIGINT NOT NULL,
|
parent_post_id BIGINT NOT NULL,
|
||||||
parent_comment_id BIGINT,
|
-- parent_comment_id BIGINT,
|
||||||
author_user_id BIGINT NOT NULL,
|
author_user_id BIGINT NOT NULL,
|
||||||
content TEXT NOT NULL,
|
content TEXT NOT NULL,
|
||||||
upvotes INTEGER NOT NULL DEFAULT 0,
|
upvotes INTEGER NOT NULL DEFAULT 0,
|
||||||
|
@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS comments (
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
FOREIGN KEY (parent_post_id) REFERENCES posts (id),
|
FOREIGN KEY (parent_post_id) REFERENCES posts (id),
|
||||||
FOREIGN KEY (parent_comment_id) REFERENCES comments (id),
|
-- FOREIGN KEY (parent_comment_id) REFERENCES comments (id),
|
||||||
FOREIGN KEY (author_user_id) REFERENCES users (id)
|
FOREIGN KEY (author_user_id) REFERENCES users (id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -43,5 +43,5 @@ FOR EACH ROW
|
||||||
EXECUTE FUNCTION comments_set_updated_at();
|
EXECUTE FUNCTION comments_set_updated_at();
|
||||||
|
|
||||||
CREATE INDEX comments_parent_post_id_index ON comments (parent_post_id);
|
CREATE INDEX comments_parent_post_id_index ON comments (parent_post_id);
|
||||||
CREATE INDEX comments_parent_comment_id_index ON comments (parent_comment_id);
|
-- CREATE INDEX comments_parent_comment_id_index ON comments (parent_comment_id);
|
||||||
CREATE INDEX comments_user_id_index ON comments (author_user_id);
|
CREATE INDEX comments_user_id_index ON comments (author_user_id);
|
Loading…
Reference in a new issue