From 2c6267d85d64c6cf9a952cfc2ed310248009775c Mon Sep 17 00:00:00 2001 From: Tofik Hasanov Date: Tue, 19 May 2026 11:28:15 -0400 Subject: [PATCH] fix(db): remove duplicate add-finding-to-CommentEntityType migration Two parallel branches independently added 'finding' to the CommentEntityType enum: - 20260513220233_comment_entity_type_finding (from feat(cloud-tests): auditor visibility improvements, merged May 13) - 20260512120000_add_finding_to_comment_entity_type (from feat: add comments to findings, merged May 19 in PR #2827) The May 13 migration was deployed to staging first and recorded the enum label. When the main->release deploy ran prisma migrate deploy on staging, it tried to apply the earlier-timestamped May 12 migration and failed with P3018 / 42710 ("enum label \"finding\" already exists") because the value was already present. Both migrations did the same thing; keep the one that was actually deployed (May 13) and remove the duplicate. The schema is unchanged because the post-migration enum is identical. A one-time manual step is required on staging (and any environment where prisma migrate deploy has already recorded the failed migration) to clear the failed migration record: prisma migrate resolve --rolled-back \ 20260512120000_add_finding_to_comment_entity_type After that, prisma migrate deploy is a no-op for this change because the only remaining migration (May 13) is already applied. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../migration.sql | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 packages/db/prisma/migrations/20260512120000_add_finding_to_comment_entity_type/migration.sql diff --git a/packages/db/prisma/migrations/20260512120000_add_finding_to_comment_entity_type/migration.sql b/packages/db/prisma/migrations/20260512120000_add_finding_to_comment_entity_type/migration.sql deleted file mode 100644 index cb81b5250..000000000 --- a/packages/db/prisma/migrations/20260512120000_add_finding_to_comment_entity_type/migration.sql +++ /dev/null @@ -1,2 +0,0 @@ --- AlterEnum -ALTER TYPE "CommentEntityType" ADD VALUE 'finding';