Limiting Notification string fields

This commit is contained in:
rockstardev 2020-06-12 00:16:50 -05:00
parent 0c170fc399
commit 2f4967a23a
3 changed files with 31 additions and 3 deletions

View file

@ -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; }

View file

@ -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)
{
}
}
}

View file

@ -246,10 +246,12 @@ namespace BTCPayServer.Migrations
modelBuilder.Entity("BTCPayServer.Data.NotificationData", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasMaxLength(36);
b.Property<string>("ApplicationUserId")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasMaxLength(50);
b.Property<byte[]>("Blob")
.HasColumnType("BLOB");
@ -258,7 +260,8 @@ namespace BTCPayServer.Migrations
.HasColumnType("TEXT");
b.Property<string>("NotificationType")
.HasColumnType("TEXT");
.HasColumnType("TEXT")
.HasMaxLength(100);
b.Property<bool>("Seen")
.HasColumnType("INTEGER");