Iceshrimp.NET/Iceshrimp.Backend/Core/Database/Tables/UserNotePin.cs
2024-01-07 19:43:41 +01:00

33 lines
No EOL
950 B
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace Iceshrimp.Backend.Core.Database.Tables;
[Table("user_note_pin")]
[Index("UserId", "NoteId", IsUnique = true)]
[Index("UserId")]
public class UserNotePin {
[Key]
[Column("id")]
[StringLength(32)]
public string Id { get; set; } = null!;
/// <summary>
/// The created date of the UserNotePins.
/// </summary>
[Column("createdAt")]
public DateTime CreatedAt { get; set; }
[Column("userId")] [StringLength(32)] public string UserId { get; set; } = null!;
[Column("noteId")] [StringLength(32)] public string NoteId { get; set; } = null!;
[ForeignKey("NoteId")]
[InverseProperty("UserNotePins")]
public virtual Note Note { get; set; } = null!;
[ForeignKey("UserId")]
[InverseProperty("UserNotePins")]
public virtual User User { get; set; } = null!;
}