From 73cfee575d9e31014ca4f6adee1be16abbde68e8 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Thu, 8 Jan 2026 15:42:42 +0100 Subject: [PATCH] Clean up unsupported threepids from already deactivated users --- ...040_remove_deactivated_unsupported_threepids.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 crates/storage-pg/migrations/20260108144040_remove_deactivated_unsupported_threepids.sql diff --git a/crates/storage-pg/migrations/20260108144040_remove_deactivated_unsupported_threepids.sql b/crates/storage-pg/migrations/20260108144040_remove_deactivated_unsupported_threepids.sql new file mode 100644 index 000000000..5c57a734a --- /dev/null +++ b/crates/storage-pg/migrations/20260108144040_remove_deactivated_unsupported_threepids.sql @@ -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;