2025-01-29 22:51:59 +13:00
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
2024-09-20 21:07:27 +12:00
|
|
|
namespace EllieBot.Db.Models;
|
|
|
|
|
|
|
|
public class SlowmodeIgnoredRole : DbEntity
|
|
|
|
{
|
2025-01-29 22:51:59 +13:00
|
|
|
public ulong GuildId { get; set; }
|
2024-09-20 21:07:27 +12:00
|
|
|
public ulong RoleId { get; set; }
|
2025-01-29 22:51:59 +13:00
|
|
|
}
|
2024-09-20 21:07:27 +12:00
|
|
|
|
2025-01-29 22:51:59 +13:00
|
|
|
public class SlowmodeIgnoredRoleEntityConfiguration : IEntityTypeConfiguration<SlowmodeIgnoredRole>
|
|
|
|
{
|
|
|
|
public void Configure(EntityTypeBuilder<SlowmodeIgnoredRole> builder)
|
2024-09-20 21:07:27 +12:00
|
|
|
{
|
2025-01-29 22:51:59 +13:00
|
|
|
builder.HasIndex(x => new
|
|
|
|
{
|
|
|
|
x.GuildId,
|
|
|
|
x.RoleId
|
|
|
|
})
|
|
|
|
.IsUnique();
|
2024-09-20 21:07:27 +12:00
|
|
|
}
|
|
|
|
}
|