Skip to content

Commit 526e5eb

Browse files
committed
Refactor sign-up email index management in ProjectUser model
- Removed the existing index for signUpEmailNormalized from the finalize_signup_fraud_protection migration. - Created a new migration to add the signUpEmailNormalized index, ensuring better organization and clarity in the migration history. - This change enhances the database schema by maintaining a clear separation of index creation across migrations.
1 parent 1861da9 commit 526e5eb

File tree

2 files changed

+5
-6
lines changed
  • apps/backend/prisma/migrations

2 files changed

+5
-6
lines changed

apps/backend/prisma/migrations/20260308000002_finalize_signup_fraud_protection/migration.sql

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ CREATE INDEX CONCURRENTLY IF NOT EXISTS "ProjectUser_signUpIp_recent_idx"
1717
CREATE INDEX CONCURRENTLY IF NOT EXISTS "ProjectUser_signUpEmailBase_recent_idx"
1818
ON "ProjectUser"("tenancyId", "isAnonymous", "signUpEmailBase", "signedUpAt");
1919

20-
-- SPLIT_STATEMENT_SENTINEL
21-
-- SINGLE_STATEMENT_SENTINEL
22-
-- RUN_OUTSIDE_TRANSACTION_SENTINEL
23-
CREATE INDEX CONCURRENTLY IF NOT EXISTS "ProjectUser_signUpEmailNormalized_recent_idx"
24-
ON "ProjectUser"("tenancyId", "isAnonymous", "signUpEmailNormalized", "signedUpAt");
25-
2620
-- Validate the risk score bounds once every row has the new columns.
2721
-- SPLIT_STATEMENT_SENTINEL
2822
-- SINGLE_STATEMENT_SENTINEL
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-- SPLIT_STATEMENT_SENTINEL
2+
-- SINGLE_STATEMENT_SENTINEL
3+
-- RUN_OUTSIDE_TRANSACTION_SENTINEL
4+
CREATE INDEX CONCURRENTLY IF NOT EXISTS "ProjectUser_signUpEmailNormalized_recent_idx"
5+
ON "ProjectUser"("tenancyId", "isAnonymous", "signUpEmailNormalized", "signedUpAt");

0 commit comments

Comments
 (0)