split warn punishments into a separate table

Added warn endpoints
Reminders should now be able to ping everyone if the user who created the reminder has that permission
This commit is contained in:
Toastie 2024-10-23 19:20:55 +13:00
parent aca7ace527
commit 17d4d2a925
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4
27 changed files with 7434 additions and 214 deletions
src/EllieBot/Db

View file

@ -194,11 +194,6 @@ public abstract class EllieContext : DbContext
.WithOne()
.OnDelete(DeleteBehavior.Cascade);
modelBuilder.Entity<GuildConfig>()
.HasMany(x => x.WarnPunishments)
.WithOne()
.OnDelete(DeleteBehavior.Cascade);
modelBuilder.Entity<GuildConfig>()
.HasMany(x => x.SlowmodeIgnoredRoles)
.WithOne()
@ -276,6 +271,18 @@ public abstract class EllieContext : DbContext
#endregion
#region WarningPunishments
var warnpunishmentEntity = modelBuilder.Entity<WarningPunishment>(b =>
{
b.HasAlternateKey(x => new
{
x.GuildId,
x.Count
});
});
#endregion
#region Self Assignable Roles
@ -338,6 +345,7 @@ public abstract class EllieContext : DbContext
du.HasIndex(x => x.TotalXp);
du.HasIndex(x => x.CurrencyAmount);
du.HasIndex(x => x.UserId);
du.HasIndex(x => x.Username);
});
#endregion