26 lines
No EOL
663 B
C#
26 lines
No EOL
663 B
C#
#nullable disable
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace EllieBot.Db.Models;
|
|
|
|
public class UnbanTimer : DbEntity
|
|
{
|
|
public ulong GuildId { get; set; }
|
|
public ulong UserId { get; set; }
|
|
public DateTime UnbanAt { get; set; }
|
|
}
|
|
|
|
public class UnbanTimerEntityConfiguration : IEntityTypeConfiguration<UnbanTimer>
|
|
{
|
|
public void Configure(EntityTypeBuilder<UnbanTimer> builder)
|
|
{
|
|
builder.HasIndex(x => new
|
|
{
|
|
x.GuildId,
|
|
x.UserId
|
|
})
|
|
.IsUnique();
|
|
}
|
|
} |