-- DropForeignKey
ALTER TABLE "tbl_favourites" DROP CONSTRAINT "tbl_favourites_product_id_fkey";

-- AlterTable
ALTER TABLE "tbl_favourites" ADD COLUMN     "brand_id" BIGINT,
ALTER COLUMN "product_id" DROP NOT NULL;

-- CreateIndex
CREATE INDEX "tbl_favourites_user_id_idx" ON "tbl_favourites"("user_id");

-- CreateIndex
CREATE INDEX "tbl_favourites_product_id_idx" ON "tbl_favourites"("product_id");

-- CreateIndex
CREATE INDEX "tbl_favourites_brand_id_idx" ON "tbl_favourites"("brand_id");

-- AddForeignKey
ALTER TABLE "tbl_favourites" ADD CONSTRAINT "tbl_favourites_brand_id_fkey" FOREIGN KEY ("brand_id") REFERENCES "tbl_user"("id") ON DELETE SET NULL ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "tbl_favourites" ADD CONSTRAINT "tbl_favourites_product_id_fkey" FOREIGN KEY ("product_id") REFERENCES "tbl_product"("id") ON DELETE SET NULL ON UPDATE CASCADE;
