From 27613410dd9e4ecc2bf611f89c1cbfe727323d28 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Thu, 18 Nov 2021 18:01:02 +0100 Subject: [PATCH] Another migration fix for users who manually edited their databasea and are unable to update to v3 due to invalid db state. --- src/NadekoBot/Migrations/20210707002343_cleanup.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/NadekoBot/Migrations/20210707002343_cleanup.cs b/src/NadekoBot/Migrations/20210707002343_cleanup.cs index 9b25c481c..70c3aee72 100644 --- a/src/NadekoBot/Migrations/20210707002343_cleanup.cs +++ b/src/NadekoBot/Migrations/20210707002343_cleanup.cs @@ -16,8 +16,13 @@ namespace NadekoBot.Migrations migrationBuilder.Sql("DELETE FROM FilteredWord WHERE GuildConfigId NOT IN (SELECT Id from GuildConfigs)"); migrationBuilder.Sql("DELETE FROM FilterChannelId WHERE GuildConfigId NOT IN (SELECT Id from GuildConfigs)"); migrationBuilder.Sql("DELETE FROM CommandCooldown WHERE GuildConfigId NOT IN (SELECT Id from GuildConfigs)"); + + // fix for users who edited their waifuinfo table manually and are unable to update migrationBuilder.Sql("DELETE FROM WaifuInfo where WaifuId not in (SELECT Id from DiscordUser);"); + // fix for users who deleted clubs manually and are unable to update now + migrationBuilder.Sql("UPDATE DiscordUser SET ClubId = null WHERE ClubId is not null and ClubId not in (SELECT Id from Clubs);"); + migrationBuilder.DropColumn( name: "ChannelCreated", table: "LogSettings");