From b9b53ef3e8b7daa545ef280b9d0ae1dab2e89ab4 Mon Sep 17 00:00:00 2001 From: Toastie <toastie@toastiet0ast.com> Date: Fri, 14 Mar 2025 23:32:23 +1300 Subject: [PATCH] I did a dumb and broke the migration --- src/EllieBot/Migrations/Sqlite/20250126062816_cleanup.sql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/EllieBot/Migrations/Sqlite/20250126062816_cleanup.sql b/src/EllieBot/Migrations/Sqlite/20250126062816_cleanup.sql index fa8bfcd..72b40a0 100644 --- a/src/EllieBot/Migrations/Sqlite/20250126062816_cleanup.sql +++ b/src/EllieBot/Migrations/Sqlite/20250126062816_cleanup.sql @@ -171,7 +171,7 @@ DELETE FROM Permissions WHERE GuildConfigId IS NULL OR GuildConfigId NOT IN (SEL UPDATE Permissions SET GuildId = (SELECT GuildId FROM GuildConfigs WHERE GuildConfigs.Id = Permissions.GuildConfigId); -DELETE FROM MutedUserId WHERE GuildConfigId IS NULL OR GuildConfigId NOT IN (SELECT Id FROM GuildConfigs); +DELETE FROM MutedUserId WHERE GuildConfigId IS NULL OR GuildConfigId NOT IN (SELECT Id FROM GuildConfigs) OR (GuildId, UserId) IN (SELECT GuildId, UserId FROM MutedUserId GROUP BY GuildId, UserId HAVING COUNT(*) > 1); UPDATE MutedUserId SET GuildId = (SELECT GuildId FROM GuildConfigs WHERE GuildConfigs.Id = MutedUserId.GuildConfigId); @@ -763,4 +763,3 @@ INSERT INTO "__EFMigrationsHistory" ("MigrationId", "ProductVersion") VALUES ('20250126062816_cleanup', '8.0.8'); COMMIT; -