-- CreateTable
CREATE TABLE `CallRecording` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `callId` INTEGER NOT NULL,
    `agentId` INTEGER NULL,
    `url` VARCHAR(191) NOT NULL,
    `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),

    INDEX `CallRecording_callId_idx`(`callId`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateIndex
CREATE INDEX `ContactPhone_numberE164_contactId_idx` ON `ContactPhone`(`numberE164`, `contactId`);

-- CreateIndex
CREATE INDEX `ContactPhone_numberE164_idx` ON `ContactPhone`(`numberE164`);

-- AddForeignKey
ALTER TABLE `CallRecording` ADD CONSTRAINT `CallRecording_callId_fkey` FOREIGN KEY (`callId`) REFERENCES `Call`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
