From 26490e32d85365f9d1208cc0cd98fa2085b919b3 Mon Sep 17 00:00:00 2001 From: Bentlybro Date: Fri, 13 Feb 2026 15:11:48 +0000 Subject: [PATCH] fix(schema): add composite index for LlmModelMigration active queries Adds @@index([sourceModelSlug, isReverted]) to match the migration SQL. This prevents Prisma migration conflicts and optimizes queries for non-reverted migrations by source model slug. --- autogpt_platform/backend/schema.prisma | 1 + 1 file changed, 1 insertion(+) diff --git a/autogpt_platform/backend/schema.prisma b/autogpt_platform/backend/schema.prisma index c0d0fa68be..3288c1b9e7 100644 --- a/autogpt_platform/backend/schema.prisma +++ b/autogpt_platform/backend/schema.prisma @@ -1289,6 +1289,7 @@ model LlmModelMigration { @@index([sourceModelSlug]) @@index([targetModelSlug]) @@index([isReverted]) + @@index([sourceModelSlug, isReverted]) // Composite index for active migration queries } ////////////// OAUTH PROVIDER TABLES ////////////////// ////////////////////////////////////////////////////////////