/*
  Warnings:

  - You are about to drop the column `identifier` on the `leads` table. All the data in the column will be lost.
  - A unique constraint covering the columns `[email_identifier]` on the table `leads` will be added. If there are existing duplicate values, this will fail.
  - A unique constraint covering the columns `[phone_identifier]` on the table `leads` will be added. If there are existing duplicate values, this will fail.
  - Added the required column `email_identifier` to the `leads` table without a default value. This is not possible if the table is not empty.
  - Added the required column `phone_identifier` to the `leads` table without a default value. This is not possible if the table is not empty.

*/
-- DropIndex
DROP INDEX `leads_identifier_key` ON `leads`;

-- DropIndex
DROP INDEX `leads_origin_id_fkey` ON `leads`;

-- AlterTable
ALTER TABLE `leads` DROP COLUMN `identifier`,
    ADD COLUMN `email_identifier` VARCHAR(191) NOT NULL,
    ADD COLUMN `phone_identifier` VARCHAR(191) NOT NULL;

-- CreateIndex
CREATE UNIQUE INDEX `leads_email_identifier_key` ON `leads`(`email_identifier`);

-- CreateIndex
CREATE UNIQUE INDEX `leads_phone_identifier_key` ON `leads`(`phone_identifier`);

-- AddForeignKey
ALTER TABLE `leads` ADD CONSTRAINT `leads_origin_id_fkey` FOREIGN KEY (`origin_id`) REFERENCES `origins`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
