Skip to content

Commit

Permalink
Cleanup the unverified emails from the database
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhose committed Jan 15, 2025
1 parent 1ec6192 commit a39e1d3
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- Copyright 2025 New Vector Ltd.
--
-- SPDX-License-Identifier: AGPL-3.0-only
-- Please see LICENSE in the repository root for full details.

-- This drops all the unverified email addresses from the database, as they are
-- now always verified when they land in the user_emails table.
-- We don't drop the `confirmed_at` column to allow rolling back

-- First, truncate all the confirmation codes
TRUNCATE TABLE email_confirmation_codes;

-- Then, delete all the unverified email addresses
DELETE FROM user_emails WHERE confirmed_at IS NULL;

0 comments on commit a39e1d3

Please sign in to comment.