Changed all MaxLength to be 64, 128, 256, or 2048 probably we need to review this

This commit is contained in:
Jonathan Bourdon
2024-08-04 21:52:09 -04:00
parent 143774340f
commit e617b5ffd3
9 changed files with 34 additions and 32 deletions

View File

@@ -7,8 +7,8 @@ public class Message
public Guid Id { get; set; }
public Guid SubjectId { get; set; }
public Guid CreatedBy { get; set; }
[MaxLength(64)] public required string CreatedByName { get; set; }
[MaxLength(256)] public string? CreatedByPortraitUrl { get; set; }
[MaxLength(255)] public required string CreatedByName { get; set; }
[MaxLength(255)] public string? CreatedByPortraitUrl { get; set; }
public DateTimeOffset CreatedAt { get; set; }
public Guid? ParentId { get; set; }
public required string Value { get; set; }

View File

@@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Hutopy.Web.Features.Messages.Migrations
{
[DbContext(typeof(MessagingDbContext))]
[Migration("20240802044717_Initial")]
[Migration("20240805012343_Initial")]
partial class Initial
{
/// <inheritdoc />
@@ -42,12 +42,12 @@ namespace Hutopy.Web.Features.Messages.Migrations
b.Property<string>("CreatedByName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<string>("CreatedByPortraitUrl")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<Guid?>("ParentId")
.HasColumnType("uuid");

View File

@@ -22,8 +22,8 @@ namespace Hutopy.Web.Features.Messages.Migrations
Id = table.Column<Guid>(type: "uuid", nullable: false),
SubjectId = table.Column<Guid>(type: "uuid", nullable: false),
CreatedBy = table.Column<Guid>(type: "uuid", nullable: false),
CreatedByName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
CreatedByPortraitUrl = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
CreatedByName = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
CreatedByPortraitUrl = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"),
ParentId = table.Column<Guid>(type: "uuid", nullable: true),
Value = table.Column<string>(type: "text", nullable: false)

View File

@@ -39,12 +39,12 @@ namespace Hutopy.Web.Features.Messages.Migrations
b.Property<string>("CreatedByName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<string>("CreatedByPortraitUrl")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.Property<Guid?>("ParentId")
.HasColumnType("uuid");