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

    INDEX `consumer_account_goods_favorites_goods_id_idx`(`goods_id`),
    INDEX `consumer_account_goods_favorites_consumer_account_id_idx`(`consumer_account_id`),
    PRIMARY KEY (`consumer_account_id`, `goods_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `consumer_account_goods_favorites` ADD CONSTRAINT `consumer_account_goods_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_goods_favorites` ADD CONSTRAINT `consumer_account_goods_favorites_goods_id_fkey` FOREIGN KEY (`goods_id`) REFERENCES `goods`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
