From 792e1411833579a928ba133dbe975103099afb63 Mon Sep 17 00:00:00 2001 From: abhi1992002 Date: Tue, 17 Feb 2026 10:28:43 +0530 Subject: [PATCH] refactor(library): remove unnecessary indexes from LibraryFolder model and migration - Removed the `@@index` directives for `userId` and `parentId` from the `LibraryFolder` model in `schema.prisma` to streamline the database schema. - Updated the migration SQL file to reflect these changes, ensuring a cleaner migration process. - These modifications enhance the efficiency of the database structure by eliminating redundant indexing. --- .../migration.sql | 17 ----------------- autogpt_platform/backend/schema.prisma | 2 -- 2 files changed, 19 deletions(-) diff --git a/autogpt_platform/backend/migrations/20260123110033_add_folders_in_library/migration.sql b/autogpt_platform/backend/migrations/20260123110033_add_folders_in_library/migration.sql index 130b7fb8c4..83ca008fe6 100644 --- a/autogpt_platform/backend/migrations/20260123110033_add_folders_in_library/migration.sql +++ b/autogpt_platform/backend/migrations/20260123110033_add_folders_in_library/migration.sql @@ -1,18 +1,6 @@ -/* - Warnings: - - - You are about to drop the column `search` on the `StoreListingVersion` table. All the data in the column will be lost. - -*/ --- DropIndex -DROP INDEX "UnifiedContentEmbedding_search_idx"; - -- AlterTable ALTER TABLE "LibraryAgent" ADD COLUMN "folderId" TEXT; --- AlterTable -ALTER TABLE "StoreListingVersion" DROP COLUMN "search"; - -- CreateTable CREATE TABLE "LibraryFolder" ( "id" TEXT NOT NULL, @@ -28,11 +16,6 @@ CREATE TABLE "LibraryFolder" ( CONSTRAINT "LibraryFolder_pkey" PRIMARY KEY ("id") ); --- CreateIndex -CREATE INDEX "LibraryFolder_userId_isDeleted_idx" ON "LibraryFolder"("userId", "isDeleted"); - --- CreateIndex -CREATE INDEX "LibraryFolder_parentId_idx" ON "LibraryFolder"("parentId"); -- CreateIndex CREATE UNIQUE INDEX "LibraryFolder_userId_parentId_name_key" ON "LibraryFolder"("userId", "parentId", "name"); diff --git a/autogpt_platform/backend/schema.prisma b/autogpt_platform/backend/schema.prisma index 3e683815bc..5212ec0a3d 100644 --- a/autogpt_platform/backend/schema.prisma +++ b/autogpt_platform/backend/schema.prisma @@ -435,8 +435,6 @@ model LibraryFolder { LibraryAgents LibraryAgent[] @@unique([userId, parentId, name]) // Name unique per parent per user - @@index([userId, isDeleted]) - @@index([parentId]) } ////////////////////////////////////////////////////////////