diff --git a/init/00_InitDB.sql b/init/00_InitDB.sql index ef79d71..bf720ff 100644 --- a/init/00_InitDB.sql +++ b/init/00_InitDB.sql @@ -14,8 +14,6 @@ CREATE TABLE Posts ( id bigserial PRIMARY KEY, author bigserial REFERENCES Users(id) NOT NULL, - reference bigserial REFERENCES Posts(id) NOT NULL, - -- init with (select last_val from posts_id_seq) title varchar(255) NOT NULL, content varchar(1023) NOT NULL, postDate timestamp WITH TIME ZONE NOT NULL DEFAULT now(), @@ -23,6 +21,13 @@ CREATE TABLE Posts deleted timestamp WITH TIME ZONE default NULL ); +CREATE TABLE Answers ( + id bigserial PRIMARY KEY, + parent bigserial REFERENCES Posts, + child bigserial REFERENCES Posts, + deleted timestamp WITH TIME ZONE default NULL +); + CREATE TABLE Reaction ( id bigserial PRIMARY KEY,