Schema add Notifications

This commit is contained in:
2024-12-16 17:35:36 +01:00
parent 538e6fa60b
commit 84833acdeb
6 changed files with 40 additions and 6 deletions

View File

@ -0,0 +1,24 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
namespace API.Schema;
[PrimaryKey("AltTitleId")]
public class Notification(string title, string message = "", Notification.NotificationUrgency notificationUrgency = Notification.NotificationUrgency.Normal)
{
[MaxLength(64)]
public string NotificationId { get; init; } = TokenGen.CreateToken("Notification", 64);
public NotificationUrgency Urgency { get; init; } = notificationUrgency;
public string Title { get; init; } = title;
public string Message { get; init; } = message;
public enum NotificationUrgency : byte
{
Low = 0,
Normal = 1,
High = 3
}
}

View File

@ -18,6 +18,7 @@ public class PgsqlContext(DbContextOptions<PgsqlContext> options) : DbContext(op
public DbSet<MangaAltTitle> AltTitles { get; set; }
public DbSet<LibraryConnector> LibraryConnectors { get; set; }
public DbSet<NotificationConnector> NotificationConnectors { get; set; }
public DbSet<Notification> Notifications { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{