moved post relations to own table
This commit is contained in:
@@ -14,8 +14,6 @@ CREATE TABLE Posts
|
|||||||
(
|
(
|
||||||
id bigserial PRIMARY KEY,
|
id bigserial PRIMARY KEY,
|
||||||
author bigserial REFERENCES Users(id) NOT NULL,
|
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,
|
title varchar(255) NOT NULL,
|
||||||
content varchar(1023) NOT NULL,
|
content varchar(1023) NOT NULL,
|
||||||
postDate timestamp WITH TIME ZONE NOT NULL DEFAULT now(),
|
postDate timestamp WITH TIME ZONE NOT NULL DEFAULT now(),
|
||||||
@@ -23,6 +21,13 @@ CREATE TABLE Posts
|
|||||||
deleted timestamp WITH TIME ZONE default NULL
|
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
|
CREATE TABLE Reaction
|
||||||
(
|
(
|
||||||
id bigserial PRIMARY KEY,
|
id bigserial PRIMARY KEY,
|
||||||
|
|||||||
Reference in New Issue
Block a user