using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using Microsoft.EntityFrameworkCore; namespace Mizuki.Database.Models; /// /// An uploaded file. /// [Index(nameof(Filename), IsUnique = true)] public class Upload { /// /// The ID of the uploaded file. /// [Key] public required Guid Id { get; set; } /// /// The filename. /// public required string Filename { get; set; } /// /// The filename. /// public required string OriginalFilename { get; set; } /// /// The size of the file in bytes. /// public required long SizeInBytes { get; set; } /// /// The time of upload. /// public required DateTimeOffset TimeOfUpload { get; set; } /// /// The author of the uploaded file. /// public required User Author { get; set; } /// /// The ID of the author. /// [ForeignKey(nameof(Author))] public required Guid AuthorId { get; set; } }