Iceshrimp.NET/Iceshrimp.Backend/Core/Database/Tables/NoteFavorite.cs
2023-12-24 00:57:07 +01:00

33 lines
No EOL
1 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;
namespace Iceshrimp.Backend.Core.Database.Tables;
[Table("note_favorite")]
[Index("UserId", "NoteId", Name = "IDX_0f4fb9ad355f3effff221ef245", IsUnique = true)]
[Index("UserId", Name = "IDX_47f4b1892f5d6ba8efb3057d81")]
public class NoteFavorite {
[Key]
[Column("id")]
[StringLength(32)]
public string Id { get; set; } = null!;
/// <summary>
/// The created date of the NoteFavorite.
/// </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("NoteFavorites")]
public virtual Note Note { get; set; } = null!;
[ForeignKey("UserId")]
[InverseProperty("NoteFavorites")]
public virtual User User { get; set; } = null!;
}