/*
  Warnings:

  - You are about to drop the column `image` on the `Customer` table. All the data in the column will be lost.
  - A unique constraint covering the columns `[imageId]` on the table `Customer` will be added. If there are existing duplicate values, this will fail.

*/
-- AlterTable
ALTER TABLE `Customer` DROP COLUMN `image`,
    ADD COLUMN `imageId` INTEGER NULL;

-- CreateIndex
CREATE UNIQUE INDEX `Customer_imageId_key` ON `Customer`(`imageId`);

-- AddForeignKey
ALTER TABLE `Customer` ADD CONSTRAINT `Customer_imageId_fkey` FOREIGN KEY (`imageId`) REFERENCES `Media`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
