Removing everything to do with parent_comment_id in comment table for now

This commit is contained in:
Imbus 2024-03-06 08:04:26 +01:00
parent 3d40ec513e
commit 32ff43e87c

View file

@ -1,7 +1,7 @@
CREATE TABLE IF NOT EXISTS comments (
id BIGSERIAL PRIMARY KEY,
id SERIAL PRIMARY KEY NOT NULL,
parent_post_id BIGINT NOT NULL,
parent_comment_id BIGINT,
-- parent_comment_id BIGINT,
author_user_id BIGINT NOT NULL,
content TEXT NOT NULL,
upvotes INTEGER NOT NULL DEFAULT 0,
@ -9,7 +9,7 @@ CREATE TABLE IF NOT EXISTS comments (
created_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_comment_id) REFERENCES comments (id),
-- FOREIGN KEY (parent_comment_id) REFERENCES comments (id),
FOREIGN KEY (author_user_id) REFERENCES users (id)
);
@ -43,5 +43,5 @@ FOR EACH ROW
EXECUTE FUNCTION comments_set_updated_at();
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);