-- CreateTable
CREATE TABLE "call_active_products" (
    "id" SERIAL NOT NULL,
    "callId" TEXT NOT NULL,
    "callerId" TEXT NOT NULL,
    "productId" INTEGER NOT NULL,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

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

-- CreateIndex
CREATE INDEX "call_active_products_callId_idx" ON "call_active_products"("callId");

-- CreateIndex
CREATE INDEX "call_active_products_callerId_idx" ON "call_active_products"("callerId");

-- CreateIndex
CREATE INDEX "call_active_products_productId_idx" ON "call_active_products"("productId");

-- AddForeignKey
ALTER TABLE "call_active_products" ADD CONSTRAINT "call_active_products_productId_fkey" FOREIGN KEY ("productId") REFERENCES "products"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
