-- DropForeignKey
ALTER TABLE `customer_individuals` DROP FOREIGN KEY `customer_individuals_customer_id_fkey`;

-- DropForeignKey
ALTER TABLE `customer_legal` DROP FOREIGN KEY `customer_legal_customer_id_fkey`;

-- AlterTable
ALTER TABLE `customers` ADD COLUMN `unknown_customer` JSON NULL;

-- CreateIndex
CREATE INDEX `customer_individuals_complex_id_idx` ON `customer_individuals`(`complex_id`);

-- CreateIndex
CREATE INDEX `customer_legal_complex_id_idx` ON `customer_legal`(`complex_id`);

-- AddForeignKey
ALTER TABLE `customer_individuals` ADD CONSTRAINT `customer_individuals_customer_id_fkey` FOREIGN KEY (`customer_id`) REFERENCES `customers`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `customer_legal` ADD CONSTRAINT `customer_legal_customer_id_fkey` FOREIGN KEY (`customer_id`) REFERENCES `customers`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
