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 MutedUserId : DbEntity
|
|
|
|
{
|
2025-01-29 22:51:59 +13:00
|
|
|
public ulong GuildId { get; set; }
|
2024-09-20 21:07:27 +12:00
|
|
|
public ulong UserId { 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 MutedUserIdEntityConfiguration : IEntityTypeConfiguration<MutedUserId>
|
|
|
|
{
|
|
|
|
public void Configure(EntityTypeBuilder<MutedUserId> builder)
|
|
|
|
{
|
|
|
|
builder.HasIndex(x => new
|
|
|
|
{
|
|
|
|
x.GuildId,
|
|
|
|
x.UserId
|
|
|
|
})
|
|
|
|
.IsUnique();
|
|
|
|
}
|
2024-09-20 21:07:27 +12:00
|
|
|
}
|