From fbd7b3a745e2f34a80034639e40333eebfc03646 Mon Sep 17 00:00:00 2001 From: Nils-Johan Gynther Date: Wed, 22 Apr 2026 18:50:20 +0200 Subject: [PATCH] fix: add missing index for productId in PantryItem table migration --- .../20260422130000_user_scope_pantry_meal_plan/migration.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/prisma/migrations/20260422130000_user_scope_pantry_meal_plan/migration.sql b/backend/prisma/migrations/20260422130000_user_scope_pantry_meal_plan/migration.sql index 349404a4..00831ec2 100644 --- a/backend/prisma/migrations/20260422130000_user_scope_pantry_meal_plan/migration.sql +++ b/backend/prisma/migrations/20260422130000_user_scope_pantry_meal_plan/migration.sql @@ -5,6 +5,7 @@ UPDATE `PantryItem` SET `userId` = (SELECT `id` FROM `User` ORDER BY `id` ASC LIMIT 1) WHERE `userId` IS NULL; +ALTER TABLE `PantryItem` ADD INDEX `PantryItem_productId_idx`(`productId`); ALTER TABLE `PantryItem` DROP INDEX `PantryItem_productId_key`; ALTER TABLE `PantryItem` MODIFY `userId` INTEGER NOT NULL; ALTER TABLE `PantryItem` ADD INDEX `PantryItem_userId_idx`(`userId`);