CREATE TABLE "post" ( "id" int PRIMARY KEY, "title" varchar(255), "body" varchar(255), "createDate" datetime, "editDate" datetime, "author" int, "liked" int, FOREIGN KEY("author") REFERENCES "user" ("id") ); 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, "post" int, "replyTo" int, "liked" int, FOREIGN KEY("author") REFERENCES "user" ("id"), FOREIGN KEY("post") REFERENCES "post" ("id"), FOREIGN KEY("replyTo") REFERENCES "comment" ("id") ); CREATE TABLE "tag" ( "id" int, "name" varchar(255) ); CREATE TABLE "post-tag" ( "postId" int, "tagId" int, FOREIGN KEY("postId") REFERENCES "post" ("id"), FOREIGN KEY("tagId") REFERENCES "tag" ("id") );