mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-17 02:03:00 -05:00
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.
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -435,8 +435,6 @@ model LibraryFolder {
|
||||
LibraryAgents LibraryAgent[]
|
||||
|
||||
@@unique([userId, parentId, name]) // Name unique per parent per user
|
||||
@@index([userId, isDeleted])
|
||||
@@index([parentId])
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user