Clean up unsupported threepids from already deactivated users (#5407)

This commit is contained in:
Quentin Gliech
2026-01-23 17:42:46 +01:00
committed by GitHub

View File

@@ -0,0 +1,13 @@
-- Copyright 2026 Element Creations Ltd.
--
-- SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
-- Please see LICENSE in the repository root for full details.
-- This removes unsupported threepids from deactivated users, as we forgot to do
-- it in the past. It's fine to do this in a migration as no one is reading from
-- this table and it is quite small. Follows up from:
-- https://github.com/element-hq/matrix-authentication-service/pull/5406
DELETE FROM user_unsupported_third_party_ids
USING users
WHERE users.deactivated_at IS NOT NULL
AND users.user_id = user_unsupported_third_party_ids.user_id;