-- CreateEnum
CREATE TYPE "CommentType" AS ENUM ('ADMIN', 'GENERAL');

-- CreateTable
CREATE TABLE "tech_request_comment" (
    "id" SERIAL NOT NULL,
    "createDate" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updateDate" TIMESTAMP(3) NOT NULL,
    "message" TEXT NOT NULL,
    "likes" INTEGER NOT NULL DEFAULT 0,
    "type" "CommentType" NOT NULL,
    "userId" INTEGER NOT NULL,
    "techRequestId" INTEGER NOT NULL,

    CONSTRAINT "tech_request_comment_pkey" PRIMARY KEY ("id")
);

-- AddForeignKey
ALTER TABLE "tech_request_comment" ADD CONSTRAINT "tech_request_comment_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "tech_request_comment" ADD CONSTRAINT "tech_request_comment_techRequestId_fkey" FOREIGN KEY ("techRequestId") REFERENCES "tech_request"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
