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