.btr and .sclr added, cleanup

This commit is contained in:
Toastie 2024-11-28 01:06:01 +13:00
parent 97094dbe5d
commit b411e8cb25
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4
119 changed files with 9181 additions and 664 deletions
src/EllieBot/Db

View file

@ -74,6 +74,30 @@ public abstract class EllieContext : DbContext
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
#region GuildColors
modelBuilder.Entity<GuildColors>()
.HasIndex(x => x.GuildId)
.IsUnique(true);
#endregion
#region Button Roles
modelBuilder.Entity<ButtonRole>(br =>
{
br.HasIndex(x => x.GuildId)
.IsUnique(false);
br.HasAlternateKey(x => new
{
x.RoleId,
x.MessageId,
});
});
#endregion
#region New Sar
modelBuilder.Entity<SarGroup>(sg =>