diff --git a/BTCPayServer.Data/Data/NotificationData.cs b/BTCPayServer.Data/Data/NotificationData.cs index 81fd8f450..e1a655ca5 100644 --- a/BTCPayServer.Data/Data/NotificationData.cs +++ b/BTCPayServer.Data/Data/NotificationData.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -9,10 +10,13 @@ namespace BTCPayServer.Data { public class NotificationData { + [MaxLength(36)] public string Id { get; set; } public DateTimeOffset Created { get; set; } + [MaxLength(50)] public string ApplicationUserId { get; set; } public ApplicationUser ApplicationUser { get; set; } + [MaxLength(100)] public string NotificationType { get; set; } public bool Seen { get; set; } public byte[] Blob { get; set; } diff --git a/BTCPayServer.Data/Migrations/20200612051342_LimitingNotificationStringFields.cs b/BTCPayServer.Data/Migrations/20200612051342_LimitingNotificationStringFields.cs new file mode 100644 index 000000000..6f519ca62 --- /dev/null +++ b/BTCPayServer.Data/Migrations/20200612051342_LimitingNotificationStringFields.cs @@ -0,0 +1,21 @@ +using BTCPayServer.Data; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace BTCPayServer.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20200612051342_LimitingNotificationStringFields")] + public class LimitingNotificationStringFields : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/BTCPayServer.Data/Migrations/ApplicationDbContextModelSnapshot.cs b/BTCPayServer.Data/Migrations/ApplicationDbContextModelSnapshot.cs index 81d8a50b2..5ae1b5f03 100644 --- a/BTCPayServer.Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/BTCPayServer.Data/Migrations/ApplicationDbContextModelSnapshot.cs @@ -246,10 +246,12 @@ namespace BTCPayServer.Migrations modelBuilder.Entity("BTCPayServer.Data.NotificationData", b => { b.Property("Id") - .HasColumnType("TEXT"); + .HasColumnType("TEXT") + .HasMaxLength(36); b.Property("ApplicationUserId") - .HasColumnType("TEXT"); + .HasColumnType("TEXT") + .HasMaxLength(50); b.Property("Blob") .HasColumnType("BLOB"); @@ -258,7 +260,8 @@ namespace BTCPayServer.Migrations .HasColumnType("TEXT"); b.Property("NotificationType") - .HasColumnType("TEXT"); + .HasColumnType("TEXT") + .HasMaxLength(100); b.Property("Seen") .HasColumnType("INTEGER");