CREATE TABLE "post" ( "id" int PRIMARY KEY, "title" varchar(255), "body" varchar(255), "createDate" datetime, "editDate" datetime, "author" int CONSTRAINT user_id REFERENCES user(id), "liked" int ); CREATE TABLE "user" ( "id" int, "username" varchar(255), "password" varchar(255), "email" varchar(255), "name" varchar(255), "role" varchar(255) ); CREATE TABLE "comment" ( "id" int, "title" varchar(255), "body" varchar(255), "date" datetime, "author" int CONSTRAINT user_id REFERENCES user(id), "post" int CONSTRAINT post_id REFERENCES post(id), "replyTo" int CONSTRAINT comment_id REFERENCES comment(id), "liked" int ); CREATE TABLE "tag" ( "id" int, "name" varchar(255) ); CREATE TABLE "post-tag" ( "postId" int CONSTRAINT post_id REFERENCES post(id), "tagId" int CONSTRAINT tag_id REFERENCES tag(id) );