Changed all MaxLength to be 64, 128, 256, or 2048 probably we need to review this
This commit is contained in:
@@ -18,7 +18,7 @@ public class Creator
|
|||||||
public class About
|
public class About
|
||||||
{
|
{
|
||||||
[MaxLength(255)] public string? Title { get; set; }
|
[MaxLength(255)] public string? Title { get; set; }
|
||||||
[MaxLength(255)] public string? Description { get; set; }
|
[MaxLength(2048)] public string? Description { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ProfileColors
|
public class ProfileColors
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
namespace Hutopy.Web.Features.Contents.Migrations
|
namespace Hutopy.Web.Features.Contents.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(ContentDbContext))]
|
[DbContext(typeof(ContentDbContext))]
|
||||||
[Migration("20240804071117_Initial")]
|
[Migration("20240805012309_Initial")]
|
||||||
partial class Initial
|
partial class Initial
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -119,8 +119,8 @@ namespace Hutopy.Web.Features.Contents.Migrations
|
|||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b1.Property<string>("Description")
|
b1.Property<string>("Description")
|
||||||
.HasMaxLength(255)
|
.HasMaxLength(2048)
|
||||||
.HasColumnType("character varying(255)");
|
.HasColumnType("character varying(2048)");
|
||||||
|
|
||||||
b1.Property<string>("Title")
|
b1.Property<string>("Title")
|
||||||
.HasMaxLength(255)
|
.HasMaxLength(255)
|
||||||
@@ -24,7 +24,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
|
|||||||
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
|
||||||
Name = table.Column<string>(type: "character varying(255)", maxLength: 255, 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_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 =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@@ -116,8 +116,8 @@ namespace Hutopy.Web.Features.Contents.Migrations
|
|||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b1.Property<string>("Description")
|
b1.Property<string>("Description")
|
||||||
.HasMaxLength(255)
|
.HasMaxLength(2048)
|
||||||
.HasColumnType("character varying(255)");
|
.HasColumnType("character varying(2048)");
|
||||||
|
|
||||||
b1.Property<string>("Title")
|
b1.Property<string>("Title")
|
||||||
.HasMaxLength(255)
|
.HasMaxLength(255)
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ public class Message
|
|||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public Guid SubjectId { get; set; }
|
public Guid SubjectId { get; set; }
|
||||||
public Guid CreatedBy { get; set; }
|
public Guid CreatedBy { get; set; }
|
||||||
[MaxLength(64)] public required string CreatedByName { get; set; }
|
[MaxLength(255)] public required string CreatedByName { get; set; }
|
||||||
[MaxLength(256)] public string? CreatedByPortraitUrl { get; set; }
|
[MaxLength(255)] public string? CreatedByPortraitUrl { get; set; }
|
||||||
public DateTimeOffset CreatedAt { get; set; }
|
public DateTimeOffset CreatedAt { get; set; }
|
||||||
public Guid? ParentId { get; set; }
|
public Guid? ParentId { get; set; }
|
||||||
public required string Value { get; set; }
|
public required string Value { get; set; }
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
namespace Hutopy.Web.Features.Messages.Migrations
|
namespace Hutopy.Web.Features.Messages.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(MessagingDbContext))]
|
[DbContext(typeof(MessagingDbContext))]
|
||||||
[Migration("20240802044717_Initial")]
|
[Migration("20240805012343_Initial")]
|
||||||
partial class Initial
|
partial class Initial
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@@ -42,12 +42,12 @@ namespace Hutopy.Web.Features.Messages.Migrations
|
|||||||
|
|
||||||
b.Property<string>("CreatedByName")
|
b.Property<string>("CreatedByName")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(64)
|
.HasMaxLength(255)
|
||||||
.HasColumnType("character varying(64)");
|
.HasColumnType("character varying(255)");
|
||||||
|
|
||||||
b.Property<string>("CreatedByPortraitUrl")
|
b.Property<string>("CreatedByPortraitUrl")
|
||||||
.HasMaxLength(256)
|
.HasMaxLength(255)
|
||||||
.HasColumnType("character varying(256)");
|
.HasColumnType("character varying(255)");
|
||||||
|
|
||||||
b.Property<Guid?>("ParentId")
|
b.Property<Guid?>("ParentId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
@@ -22,8 +22,8 @@ namespace Hutopy.Web.Features.Messages.Migrations
|
|||||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
SubjectId = table.Column<Guid>(type: "uuid", nullable: false),
|
SubjectId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||||
CreatedBy = 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),
|
CreatedByName = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: false),
|
||||||
CreatedByPortraitUrl = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
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"),
|
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"),
|
||||||
ParentId = table.Column<Guid>(type: "uuid", nullable: true),
|
ParentId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||||
Value = table.Column<string>(type: "text", nullable: false)
|
Value = table.Column<string>(type: "text", nullable: false)
|
||||||
@@ -39,12 +39,12 @@ namespace Hutopy.Web.Features.Messages.Migrations
|
|||||||
|
|
||||||
b.Property<string>("CreatedByName")
|
b.Property<string>("CreatedByName")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasMaxLength(64)
|
.HasMaxLength(255)
|
||||||
.HasColumnType("character varying(64)");
|
.HasColumnType("character varying(255)");
|
||||||
|
|
||||||
b.Property<string>("CreatedByPortraitUrl")
|
b.Property<string>("CreatedByPortraitUrl")
|
||||||
.HasMaxLength(256)
|
.HasMaxLength(255)
|
||||||
.HasColumnType("character varying(256)");
|
.HasColumnType("character varying(255)");
|
||||||
|
|
||||||
b.Property<Guid?>("ParentId")
|
b.Property<Guid?>("ParentId")
|
||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ internal class TestDataSeeder(
|
|||||||
if (contentContext.Contents.Any()) return;
|
if (contentContext.Contents.Any()) return;
|
||||||
|
|
||||||
_users.Add(await CreateUserAsync("admin", null, Roles.Administrator));
|
_users.Add(await CreateUserAsync("admin", null, Roles.Administrator));
|
||||||
_users.Add(await CreateUserAsync("userA", null));
|
var userA = await CreateUserAsync("userA", null);
|
||||||
|
_users.Add(userA);
|
||||||
_users.Add(await CreateUserAsync("userB", null));
|
_users.Add(await CreateUserAsync("userB", null));
|
||||||
|
|
||||||
foreach (var creator in _creators)
|
foreach (var creator in _creators)
|
||||||
@@ -48,6 +49,7 @@ internal class TestDataSeeder(
|
|||||||
creator.Id = creatorUser.Id;
|
creator.Id = creatorUser.Id;
|
||||||
creator.CreatedBy = creator.Id;
|
creator.CreatedBy = creator.Id;
|
||||||
|
|
||||||
|
await contentContext.Subscriptions.AddAsync(new() { CreatedBy = userA.Id, CreatorId = creator.Id });
|
||||||
await contentContext.Creators.AddAsync(creator);
|
await contentContext.Creators.AddAsync(creator);
|
||||||
|
|
||||||
var contents = GenerateContent(creator, 10);
|
var contents = GenerateContent(creator, 10);
|
||||||
@@ -256,14 +258,15 @@ internal class TestDataSeeder(
|
|||||||
ProfilePictureUrl = "/images/usersmedia/chloebeaugrand/profilepictures/profileChloeBeaugrand01.png"
|
ProfilePictureUrl = "/images/usersmedia/chloebeaugrand/profilepictures/profileChloeBeaugrand01.png"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly static Creator GuillaumeMCreator = new()
|
private readonly static Creator GuillaumeMCreator = new()
|
||||||
{
|
{
|
||||||
Name = "guillaumem",
|
Name = "guillaumem",
|
||||||
About = new()
|
About = new()
|
||||||
{
|
{
|
||||||
Title = "Page officielle",
|
Title = "Page officielle",
|
||||||
Description = "Mettre en lumière le côté humain des entrepreneurs. Chaque service, chaque produit est porteur d’une histoire, d’une passion, d’une vision unique. Mon objectif est de faire rayonner cette unicité, de créer des connexions authentiques entre ces entrepreneurs et leurs clients potentiels. Parce que derrière chaque entreprise, il y a des personnes inspirantes qui méritent d’être entendues et comprises. Et toi, quel est ton objectif pour cette année?",
|
Description =
|
||||||
|
"Mettre en lumière le côté humain des entrepreneurs. Chaque service, chaque produit est porteur d’une histoire, d’une passion, d’une vision unique. Mon objectif est de faire rayonner cette unicité, de créer des connexions authentiques entre ces entrepreneurs et leurs clients potentiels. Parce que derrière chaque entreprise, il y a des personnes inspirantes qui méritent d’être entendues et comprises. Et toi, quel est ton objectif pour cette année?",
|
||||||
},
|
},
|
||||||
ProfileColors = new()
|
ProfileColors = new()
|
||||||
{
|
{
|
||||||
@@ -279,17 +282,19 @@ internal class TestDataSeeder(
|
|||||||
StoredDataUrls = new()
|
StoredDataUrls = new()
|
||||||
{
|
{
|
||||||
BannerPictureUrl = "/images/usersmedia/guillaumeMousseau/banners/bannerGuillaumeMousseau01.png",
|
BannerPictureUrl = "/images/usersmedia/guillaumeMousseau/banners/bannerGuillaumeMousseau01.png",
|
||||||
ProfilePictureUrl = "/images/usersmedia/guillaumeMousseau/profilepictures/profileGuillaumeMousseau01.png"
|
ProfilePictureUrl =
|
||||||
|
"/images/usersmedia/guillaumeMousseau/profilepictures/profileGuillaumeMousseau01.png"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly static Creator LeffetCreator = new()
|
private readonly static Creator LeffetCreator = new()
|
||||||
{
|
{
|
||||||
Name = "leffet",
|
Name = "leffet",
|
||||||
About = new()
|
About = new()
|
||||||
{
|
{
|
||||||
Title = "Page officielle",
|
Title = "Page officielle",
|
||||||
Description = "Mettre en lumière le côté humain des entrepreneurs. Chaque service, chaque produit est porteur d’une histoire, d’une passion, d’une vision unique. Mon objectif est de faire rayonner cette unicité, de créer des connexions authentiques entre ces entrepreneurs et leurs clients potentiels. Parce que derrière chaque entreprise, il y a des personnes inspirantes qui méritent d’être entendues et comprises. Et toi, quel est ton objectif pour cette année?",
|
Description =
|
||||||
|
"Mettre en lumière le côté humain des entrepreneurs. Chaque service, chaque produit est porteur d’une histoire, d’une passion, d’une vision unique. Mon objectif est de faire rayonner cette unicité, de créer des connexions authentiques entre ces entrepreneurs et leurs clients potentiels. Parce que derrière chaque entreprise, il y a des personnes inspirantes qui méritent d’être entendues et comprises. Et toi, quel est ton objectif pour cette année?",
|
||||||
},
|
},
|
||||||
ProfileColors = new()
|
ProfileColors = new()
|
||||||
{
|
{
|
||||||
@@ -308,14 +313,15 @@ internal class TestDataSeeder(
|
|||||||
ProfilePictureUrl = "/images/usersmedia/leffet/profilepictures/leffetProfile01.png"
|
ProfilePictureUrl = "/images/usersmedia/leffet/profilepictures/leffetProfile01.png"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly static Creator MathieuCaron = new()
|
private readonly static Creator MathieuCaron = new()
|
||||||
{
|
{
|
||||||
Name = "mathieucaron",
|
Name = "mathieucaron",
|
||||||
About = new()
|
About = new()
|
||||||
{
|
{
|
||||||
Title = "Page officielle",
|
Title = "Page officielle",
|
||||||
Description = "Mettre en lumière le côté humain des entrepreneurs. Chaque service, chaque produit est porteur d’une histoire, d’une passion, d’une vision unique. Mon objectif est de faire rayonner cette unicité, de créer des connexions authentiques entre ces entrepreneurs et leurs clients potentiels. Parce que derrière chaque entreprise, il y a des personnes inspirantes qui méritent d’être entendues et comprises. Et toi, quel est ton objectif pour cette année?",
|
Description =
|
||||||
|
"Mettre en lumière le côté humain des entrepreneurs. Chaque service, chaque produit est porteur d’une histoire, d’une passion, d’une vision unique. Mon objectif est de faire rayonner cette unicité, de créer des connexions authentiques entre ces entrepreneurs et leurs clients potentiels. Parce que derrière chaque entreprise, il y a des personnes inspirantes qui méritent d’être entendues et comprises. Et toi, quel est ton objectif pour cette année?",
|
||||||
},
|
},
|
||||||
ProfileColors = new()
|
ProfileColors = new()
|
||||||
{
|
{
|
||||||
@@ -326,7 +332,6 @@ internal class TestDataSeeder(
|
|||||||
{
|
{
|
||||||
FacebookUrl = "https://www.facebook.com/MathieuCaronPro/",
|
FacebookUrl = "https://www.facebook.com/MathieuCaronPro/",
|
||||||
YoutubeUrl = "https://www.youtube.com/@lesinterviewsatypiquesdema4692",
|
YoutubeUrl = "https://www.youtube.com/@lesinterviewsatypiquesdema4692",
|
||||||
|
|
||||||
},
|
},
|
||||||
StoredDataUrls = new()
|
StoredDataUrls = new()
|
||||||
{
|
{
|
||||||
@@ -343,8 +348,5 @@ internal class TestDataSeeder(
|
|||||||
GuillaumeMCreator,
|
GuillaumeMCreator,
|
||||||
LeffetCreator,
|
LeffetCreator,
|
||||||
MathieuCaron
|
MathieuCaron
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user