34 lines
No EOL
1,005 B
C#
34 lines
No EOL
1,005 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(nameof(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(nameof(NoteId))]
|
|
[InverseProperty(nameof(Tables.Note.UserNotePins))]
|
|
public virtual Note Note { get; set; } = null!;
|
|
|
|
[ForeignKey(nameof(UserId))]
|
|
[InverseProperty(nameof(Tables.User.UserNotePins))]
|
|
public virtual User User { get; set; } = null!;
|
|
} |