-- CreateTable
CREATE TABLE "ProductVendorPrice" (
    "id" TEXT NOT NULL,
    "price" DECIMAL(12,2) NOT NULL,
    "updatedAt" TIMESTAMP(3) NOT NULL,
    "productId" TEXT NOT NULL,
    "vendorId" TEXT NOT NULL,

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

-- CreateIndex
CREATE UNIQUE INDEX "ProductVendorPrice_productId_vendorId_key" ON "ProductVendorPrice"("productId", "vendorId");

-- AddForeignKey
ALTER TABLE "ProductVendorPrice" ADD CONSTRAINT "ProductVendorPrice_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "ProductVendorPrice" ADD CONSTRAINT "ProductVendorPrice_vendorId_fkey" FOREIGN KEY ("vendorId") REFERENCES "Vendor"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
