diff --git a/package.json b/package.json index 6953d115..a570f7a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@charmverse/core", - "version": "0.126.0", + "version": "0.126.1-rc-add-indices.0", "description": "Core API for Charmverse", "type": "commonjs", "types": "./dist/cjs/index.d.ts", diff --git a/src/prisma/migrations/20250613192812_add_more_indices/migration.sql b/src/prisma/migrations/20250613192812_add_more_indices/migration.sql new file mode 100644 index 00000000..2b3a5e33 --- /dev/null +++ b/src/prisma/migrations/20250613192812_add_more_indices/migration.sql @@ -0,0 +1,50 @@ +-- CreateIndex +CREATE INDEX "Post_createdBy_idx" ON "Post"("createdBy"); + +-- CreateIndex +CREATE INDEX "Post_proposalId_idx" ON "Post"("proposalId"); + +-- CreateIndex +CREATE INDEX "Proposal_workflowId_idx" ON "Proposal"("workflowId"); + +-- CreateIndex +CREATE INDEX "Proposal_projectId_idx" ON "Proposal"("projectId"); + +-- CreateIndex +CREATE INDEX "Proposal_formId_idx" ON "Proposal"("formId"); + +-- CreateIndex +CREATE INDEX "Proposal_archived_idx" ON "Proposal"("archived"); + +-- CreateIndex +CREATE INDEX "Proposal_status_idx" ON "Proposal"("status"); + +-- CreateIndex +CREATE INDEX "Space_homePageId_idx" ON "Space"("homePageId"); + +-- CreateIndex +CREATE INDEX "Space_defaultPostCategoryId_idx" ON "Space"("defaultPostCategoryId"); + +-- CreateIndex +CREATE INDEX "Space_domain_idx" ON "Space"("domain"); + +-- CreateIndex +CREATE INDEX "Space_customDomain_idx" ON "Space"("customDomain"); + +-- CreateIndex +CREATE INDEX "Space_name_idx" ON "Space"("name"); + +-- CreateIndex +CREATE INDEX "UserNotificationMetadata_spaceId_idx" ON "UserNotificationMetadata"("spaceId"); + +-- CreateIndex +CREATE INDEX "UserNotificationMetadata_createdBy_idx" ON "UserNotificationMetadata"("createdBy"); + +-- CreateIndex +CREATE INDEX "UserNotificationMetadata_userId_idx" ON "UserNotificationMetadata"("userId"); + +-- CreateIndex +CREATE INDEX "UserSpaceAction_pageId_idx" ON "UserSpaceAction"("pageId"); + +-- CreateIndex +CREATE INDEX "UserSpaceAction_postId_idx" ON "UserSpaceAction"("postId"); diff --git a/src/prisma/migrations/migration_lock.toml b/src/prisma/migrations/migration_lock.toml index fbffa92c..044d57cd 100644 --- a/src/prisma/migrations/migration_lock.toml +++ b/src/prisma/migrations/migration_lock.toml @@ -1,3 +1,3 @@ # Please do not edit this file manually -# It should be added in your version-control system (i.e. Git) -provider = "postgresql" \ No newline at end of file +# It should be added in your version-control system (e.g., Git) +provider = "postgresql" diff --git a/src/prisma/schema.prisma b/src/prisma/schema.prisma index d09b2c3c..f67b9237 100644 --- a/src/prisma/schema.prisma +++ b/src/prisma/schema.prisma @@ -406,6 +406,11 @@ model Space { spaceExportJobs SpaceExportJob[] @@index([createdBy]) + @@index([homePageId]) + @@index([defaultPostCategoryId]) + @@index([domain]) + @@index([customDomain]) + @@index([name]) } enum SpaceExportJobStatus { @@ -610,6 +615,8 @@ model UserSpaceAction { @@index([createdBy, action]) @@index([spaceId, action]) + @@index([pageId]) + @@index([postId]) } model PageComment { @@ -1406,6 +1413,11 @@ model Proposal { @@index([spaceId]) @@index([reviewedBy]) + @@index([workflowId]) + @@index([projectId]) + @@index([formId]) + @@index([archived]) + @@index([status]) } model ProposalWorkflow { @@ -1821,6 +1833,8 @@ model Post { @@index([path]) @@index([spaceId, deletedAt]) // space feed @@index([spaceId, deletedAt, categoryId]) // category feed + @@index([createdBy]) + @@index([proposalId]) } model PostToPostTag { @@ -2065,6 +2079,10 @@ model UserNotificationMetadata { proposalNotifications ProposalNotification[] voteNotifications VoteNotification[] customNotifications CustomNotification[] + + @@index([spaceId]) + @@index([createdBy]) + @@index([userId]) } model BountyNotification {