Skip to content

Commit a39e1d3

Browse files
committed
Cleanup the unverified emails from the database
1 parent 1ec6192 commit a39e1d3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
-- Copyright 2025 New Vector Ltd.
2+
--
3+
-- SPDX-License-Identifier: AGPL-3.0-only
4+
-- Please see LICENSE in the repository root for full details.
5+
6+
-- This drops all the unverified email addresses from the database, as they are
7+
-- now always verified when they land in the user_emails table.
8+
-- We don't drop the `confirmed_at` column to allow rolling back
9+
10+
-- First, truncate all the confirmation codes
11+
TRUNCATE TABLE email_confirmation_codes;
12+
13+
-- Then, delete all the unverified email addresses
14+
DELETE FROM user_emails WHERE confirmed_at IS NULL;

0 commit comments

Comments
 (0)