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

@@ -18,7 +18,7 @@ public class Creator
public class About
{
[MaxLength(255)] public string? Title { get; set; }
[MaxLength(255)] public string? Description { get; set; }
[MaxLength(2048)] public string? Description { get; set; }
}
public class ProfileColors

View File

@@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Hutopy.Web.Features.Contents.Migrations
{
[DbContext(typeof(ContentDbContext))]
[Migration("20240804071117_Initial")]
[Migration("20240805012309_Initial")]
partial class Initial
{
/// <inheritdoc />
@@ -119,8 +119,8 @@ namespace Hutopy.Web.Features.Contents.Migrations
.HasColumnType("uuid");
b1.Property<string>("Description")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
.HasMaxLength(2048)
.HasColumnType("character varying(2048)");
b1.Property<string>("Title")
.HasMaxLength(255)

View File

@@ -24,7 +24,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
Name = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
About_Title = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
About_Description = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true)
About_Description = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: true)
},
constraints: table =>
{

View File

@@ -116,8 +116,8 @@ namespace Hutopy.Web.Features.Contents.Migrations
.HasColumnType("uuid");
b1.Property<string>("Description")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
.HasMaxLength(2048)
.HasColumnType("character varying(2048)");
b1.Property<string>("Title")
.HasMaxLength(255)

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");