From 22442434c397fd0beb7f229220a87835e4e7075e Mon Sep 17 00:00:00 2001 From: Eric Cabrel TIOGO Date: Sun, 23 Jun 2024 17:39:51 +0200 Subject: [PATCH] perf(database): remove unused index on folders (#79) --- .github/workflows/migration-db-deploy.yml | 1 + .../migration.sql | 2 ++ packages/domain/prisma/schema.prisma | 1 - 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 packages/domain/prisma/migrations/20240623153404_remove_user_id_index_in_folders_table/migration.sql diff --git a/.github/workflows/migration-db-deploy.yml b/.github/workflows/migration-db-deploy.yml index 1c3ed135..73c008ec 100644 --- a/.github/workflows/migration-db-deploy.yml +++ b/.github/workflows/migration-db-deploy.yml @@ -53,6 +53,7 @@ jobs: continue-on-error: false run: | pscale deploy-request deploy ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.DEV_DEPLOY_REQUEST_NUMBER }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} --wait + pscale deploy-request skip-revert ${{ secrets.PLANETSCALE_DATABASE_NAME }} ${{ env.DEV_DEPLOY_REQUEST_NUMBER }} --org ${{ secrets.PLANETSCALE_ORG_NAME }} - name: Deploy schema migration in the production branch if: ${{ success() }} diff --git a/packages/domain/prisma/migrations/20240623153404_remove_user_id_index_in_folders_table/migration.sql b/packages/domain/prisma/migrations/20240623153404_remove_user_id_index_in_folders_table/migration.sql new file mode 100644 index 00000000..3b927dbb --- /dev/null +++ b/packages/domain/prisma/migrations/20240623153404_remove_user_id_index_in_folders_table/migration.sql @@ -0,0 +1,2 @@ +-- DropIndex +DROP INDEX `folders_user_id_idx` ON `folders`; diff --git a/packages/domain/prisma/schema.prisma b/packages/domain/prisma/schema.prisma index 14c4490a..eb6c10ba 100644 --- a/packages/domain/prisma/schema.prisma +++ b/packages/domain/prisma/schema.prisma @@ -87,7 +87,6 @@ model Folder { @@unique([userId, parentId, name], name: "folder_name_unique_constraint") @@index([name]) @@index([category]) - @@index([userId]) @@index([parentId]) @@map("folders") }