using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace Iceshrimp.Backend.Core.Database.Tables;
[Table("blocking")]
[Index("BlockerId")]
[Index("BlockeeId")]
[Index("BlockerId", "BlockeeId", IsUnique = true)]
[Index("CreatedAt")]
public class Blocking
{
[Key]
[Column("id")]
[StringLength(32)]
public string Id { get; set; } = null!;
///
/// The created date of the Blocking.
///
[Column("createdAt")]
public DateTime CreatedAt { get; set; }
///
/// The blockee user ID.
///
[Column("blockeeId")]
[StringLength(32)]
public string BlockeeId { get; set; } = null!;
///
/// The blocker user ID.
///
[Column("blockerId")]
[StringLength(32)]
public string BlockerId { get; set; } = null!;
[ForeignKey("BlockeeId")]
[InverseProperty(nameof(User.IncomingBlocks))]
public virtual User Blockee { get; set; } = null!;
[ForeignKey("BlockerId")]
[InverseProperty(nameof(User.OutgoingBlocks))]
public virtual User Blocker { get; set; } = null!;
}