dev: split warn punishments into a separate table

api: Added warn endpoints
fix: Reminders should now be able to ping everyone if the user who created the reminder has that permission
This commit is contained in:
Kwoth
2024-10-21 03:14:46 +00:00
parent b136e7ff0e
commit c835514c7b
27 changed files with 7430 additions and 211 deletions

View File

@@ -66,4 +66,19 @@ left join guildconfigs on reactionrolemessage.guildconfigid = guildconfigs.id;")
WHERE SendBoostMessage = TRUE;
""");
}
public static void AddGuildIdsToWarningPunishment(MigrationBuilder builder)
{
builder.Sql("""
UPDATE WarningPunishment
SET GuildId = (SELECT GuildId FROM guildconfigs WHERE Id = GuildConfigId);
DELETE FROM WarningPunishment as wp
WHERE (wp.Count, wp.GuildConfigId) in (
SELECT wp2.Count, wp2.GuildConfigId FROM WarningPunishment as wp2
GROUP BY wp2.Count, wp2.GuildConfigId
HAVING COUNT(id) > 1
);
""");
}
}