From 2793c185871c92cf7d2154db776bfda094c2de75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Thu, 19 Feb 2026 12:06:58 +0400 Subject: [PATCH] Fix deletion in migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Émile Ré --- pkg/coredata/migrations/20260212T163603Z.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/coredata/migrations/20260212T163603Z.sql b/pkg/coredata/migrations/20260212T163603Z.sql index d75da3cf7..795c618d3 100644 --- a/pkg/coredata/migrations/20260212T163603Z.sql +++ b/pkg/coredata/migrations/20260212T163603Z.sql @@ -191,11 +191,13 @@ WHERE -- Delete orphan invitations: e.g. expired invitations that were never accepted WITH orphan_invitations AS ( SELECT - inv.id + inv.id, + inv.organization_id FROM iam_invitations inv LEFT JOIN identities i ON i.email_address = inv.email LEFT JOIN iam_membership_profiles p ON p.identity_id = i.id + AND p.organization_id = inv.organization_id WHERE i.id IS NULL OR p.id IS NULL