35 lines
No EOL
989 B
C#
35 lines
No EOL
989 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Iceshrimp.Backend.Core.Database.Tables;
|
|
|
|
[Table("channel_note_pin")]
|
|
[Index("ChannelId")]
|
|
[Index("ChannelId", "NoteId", IsUnique = true)]
|
|
public class ChannelNotePin {
|
|
[Key]
|
|
[Column("id")]
|
|
[StringLength(32)]
|
|
public string Id { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// The created date of the ChannelNotePin.
|
|
/// </summary>
|
|
[Column("createdAt")]
|
|
public DateTime CreatedAt { get; set; }
|
|
|
|
[Column("channelId")]
|
|
[StringLength(32)]
|
|
public string ChannelId { get; set; } = null!;
|
|
|
|
[Column("noteId")] [StringLength(32)] public string NoteId { get; set; } = null!;
|
|
|
|
[ForeignKey("ChannelId")]
|
|
[InverseProperty("ChannelNotePins")]
|
|
public virtual Channel Channel { get; set; } = null!;
|
|
|
|
[ForeignKey("NoteId")]
|
|
[InverseProperty("ChannelNotePins")]
|
|
public virtual Note Note { get; set; } = null!;
|
|
} |