Skip to content
Prev Previous commit
Next Next commit
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.
  • Loading branch information
mantrakp04 committed Apr 6, 2026
commit 526e5eba6d4a3b6ab076a8a81d4ad323cfca2a86
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ CREATE INDEX CONCURRENTLY IF NOT EXISTS "ProjectUser_signUpIp_recent_idx"
CREATE INDEX CONCURRENTLY IF NOT EXISTS "ProjectUser_signUpEmailBase_recent_idx"
ON "ProjectUser"("tenancyId", "isAnonymous", "signUpEmailBase", "signedUpAt");

-- SPLIT_STATEMENT_SENTINEL
-- SINGLE_STATEMENT_SENTINEL
-- RUN_OUTSIDE_TRANSACTION_SENTINEL
CREATE INDEX CONCURRENTLY IF NOT EXISTS "ProjectUser_signUpEmailNormalized_recent_idx"
ON "ProjectUser"("tenancyId", "isAnonymous", "signUpEmailNormalized", "signedUpAt");

-- Validate the risk score bounds once every row has the new columns.
-- SPLIT_STATEMENT_SENTINEL
-- SINGLE_STATEMENT_SENTINEL
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- SPLIT_STATEMENT_SENTINEL
-- SINGLE_STATEMENT_SENTINEL
-- RUN_OUTSIDE_TRANSACTION_SENTINEL
CREATE INDEX CONCURRENTLY IF NOT EXISTS "ProjectUser_signUpEmailNormalized_recent_idx"
ON "ProjectUser"("tenancyId", "isAnonymous", "signUpEmailNormalized", "signedUpAt");
Loading