diff --git a/src/EllieBot/Migrations/MigrationQueries.cs b/src/EllieBot/Migrations/MigrationQueries.cs index 3cd32d2..a20f4a3 100644 --- a/src/EllieBot/Migrations/MigrationQueries.cs +++ b/src/EllieBot/Migrations/MigrationQueries.cs @@ -49,5 +49,9 @@ left join guildconfigs on reactionrolemessage.guildconfigid = guildconfigs.id;") builder.Sql($""" DELETE FROM "DelMsgOnCmdChannel" WHERE "GuildConfigId" is NULL; """); + + builder.Sql(""" + DELETE FROM "WarningPunishment" WHERE "GuildConfigId" NOT IN (SELECT "Id" from "GuildConfigs"); + """); } } \ No newline at end of file