/*
  Warnings:

  - You are about to drop the `consumer_account_goods_favorites` table. If the table is not empty, all the data it contains will be lost.

*/
-- DropForeignKey
ALTER TABLE `consumer_account_goods_favorites` DROP FOREIGN KEY `consumer_account_goods_favorites_consumer_account_id_fkey`;

-- DropForeignKey
ALTER TABLE `consumer_account_goods_favorites` DROP FOREIGN KEY `consumer_account_goods_favorites_goods_id_fkey`;

-- DropTable
DROP TABLE `consumer_account_goods_favorites`;

-- CreateTable
CREATE TABLE `consumer_account_good_favorites` (
    `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `consumer_account_id` VARCHAR(191) NOT NULL,
    `good_id` VARCHAR(191) NOT NULL,

    INDEX `consumer_account_good_favorites_good_id_idx`(`good_id`),
    INDEX `consumer_account_good_favorites_consumer_account_id_idx`(`consumer_account_id`),
    PRIMARY KEY (`consumer_account_id`, `good_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `consumer_account_good_favorites` ADD CONSTRAINT `consumer_account_good_favorites_consumer_account_id_fkey` FOREIGN KEY (`consumer_account_id`) REFERENCES `consumer_accounts`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE `consumer_account_good_favorites` ADD CONSTRAINT `consumer_account_good_favorites_good_id_fkey` FOREIGN KEY (`good_id`) REFERENCES `goods`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
