-- CreateTable
CREATE TABLE "tbl_reel_like" (
    "id" SERIAL NOT NULL,
    "user_id" BIGINT,
    "reel_id" INTEGER,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

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

-- CreateIndex
CREATE INDEX "tbl_reel_like_user_id_idx" ON "tbl_reel_like"("user_id");

-- CreateIndex
CREATE INDEX "tbl_reel_like_reel_id_idx" ON "tbl_reel_like"("reel_id");

-- CreateIndex
CREATE UNIQUE INDEX "tbl_reel_like_user_id_reel_id_key" ON "tbl_reel_like"("user_id", "reel_id");

-- AddForeignKey
ALTER TABLE "tbl_reel_like" ADD CONSTRAINT "tbl_reel_like_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "tbl_user"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "tbl_reel_like" ADD CONSTRAINT "tbl_reel_like_reel_id_fkey" FOREIGN KEY ("reel_id") REFERENCES "tbl_reel"("id") ON DELETE SET NULL ON UPDATE CASCADE;
