Renames StoredDataUrls to Images

This commit is contained in:
Jonathan Bourdon
2024-08-06 01:04:15 -04:00
parent db740c161c
commit d370c2a151
12 changed files with 33 additions and 737 deletions

View File

@@ -54,7 +54,7 @@ public class ContentDbContext(
modelBuilder modelBuilder
.Entity<Creator>() .Entity<Creator>()
.OwnsOne<StoredDataUrls>(x => x.StoredDataUrls) .OwnsOne<Images>(x => x.Images)
.ToTable(nameof(StoredDataUrls)); .ToTable(nameof(Images));
} }
} }

View File

@@ -12,7 +12,7 @@ public class Creator
public About About { get; set; } = new(); public About About { get; set; } = new();
public Socials Socials { get; set; } = new(); public Socials Socials { get; set; } = new();
public ProfileColors ProfileColors { get; set; } = new(); public ProfileColors ProfileColors { get; set; } = new();
public StoredDataUrls StoredDataUrls { get; set; } = new(); public Images Images { get; set; } = new();
} }
public class About public class About
@@ -41,8 +41,8 @@ public class Socials
[MaxLength(255)] public string? WebsiteUrl { get; set; } [MaxLength(255)] public string? WebsiteUrl { get; set; }
} }
public class StoredDataUrls public class Images
{ {
[MaxLength(255)] public string? BannerPictureUrl { get; set; } [MaxLength(255)] public string? Banner { get; set; }
[MaxLength(255)] public string? ProfilePictureUrl { get; set; } [MaxLength(255)] public string? Logo { get; set; }
} }

View File

@@ -27,7 +27,7 @@ public class ChangeBannerHandler(
{ {
var creator = await context var creator = await context
.Creators .Creators
.Include(c => c.StoredDataUrls) .Include(c => c.Images)
.SingleOrDefaultAsync( .SingleOrDefaultAsync(
c => c.Id == request.CreatorId, c => c.Id == request.CreatorId,
cancellationToken: ct); cancellationToken: ct);
@@ -46,7 +46,7 @@ public class ChangeBannerHandler(
request.File.ContentType, request.File.ContentType,
ct); ct);
creator.StoredDataUrls.BannerPictureUrl = blobUrl; creator.Images.Banner = blobUrl;
await context.SaveChangesAsync(ct); await context.SaveChangesAsync(ct);

View File

@@ -27,7 +27,7 @@ public class ChangeLogoHandler(
{ {
var creator = await context var creator = await context
.Creators .Creators
.Include(c => c.StoredDataUrls) .Include(c => c.Images)
.SingleOrDefaultAsync( .SingleOrDefaultAsync(
c => c.Id == request.CreatorId, c => c.Id == request.CreatorId,
cancellationToken: ct); cancellationToken: ct);
@@ -46,7 +46,7 @@ public class ChangeLogoHandler(
request.File.ContentType, request.File.ContentType,
ct); ct);
creator.StoredDataUrls.ProfilePictureUrl = blobUrl; creator.Images.Logo = blobUrl;
await context.SaveChangesAsync(ct); await context.SaveChangesAsync(ct);

View File

@@ -63,7 +63,7 @@ public class GetCreatorByAliasHandler(
About = creator.About, About = creator.About,
Socials = creator.Socials, Socials = creator.Socials,
ProfileColors = creator.ProfileColors, ProfileColors = creator.ProfileColors,
StoredDataUrls = creator.StoredDataUrls, Images = creator.Images,
SubscriberCount = subscriberCount, SubscriberCount = subscriberCount,
}; };

View File

@@ -27,7 +27,7 @@ public class GetSubscriptionsHandler(
.Select(s => new SubscriptionModel( .Select(s => new SubscriptionModel(
s.CreatorId, s.CreatorId,
s.Creator!.Name, s.Creator!.Name,
s.Creator.StoredDataUrls.ProfilePictureUrl)) s.Creator.Images.Logo))
.ToListAsync(cancellationToken: ct); .ToListAsync(cancellationToken: ct);
await SendOkAsync(subscriptions, ct); await SendOkAsync(subscriptions, ct);

View File

@@ -11,6 +11,6 @@ public class CreatorModel
public About About { get; set; } public About About { get; set; }
public Socials Socials { get; set; } public Socials Socials { get; set; }
public ProfileColors ProfileColors { get; set; } public ProfileColors ProfileColors { get; set; }
public StoredDataUrls StoredDataUrls { get; set; } public Images Images { get; set; }
public int SubscriberCount { get; set; } public int SubscriberCount { get; set; }
} }

View File

@@ -38,7 +38,7 @@ public sealed class SubscribeToCreatorHandler(
.Select(c => new SubscriptionModel( .Select(c => new SubscriptionModel(
req.CreatorId, req.CreatorId,
c.Name, c.Name,
c.StoredDataUrls.ProfilePictureUrl c.Images.Logo
)) ))
.FirstOrDefaultAsync(cancellationToken: ct); .FirstOrDefaultAsync(cancellationToken: ct);

View File

@@ -1,258 +0,0 @@
// <auto-generated />
using System;
using Hutopy.Web.Features.Contents.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Hutopy.Web.Features.Contents.Migrations
{
[DbContext(typeof(ContentDbContext))]
[Migration("20240806041040_Initial")]
partial class Initial
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("Content")
.HasAnnotation("ProductVersion", "8.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Content", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(2048)
.HasColumnType("character varying(2048)");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string[]>("Urls")
.HasColumnType("text[]");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.ToTable("Contents", "Content");
});
modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Creator", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.HasKey("Id");
b.ToTable("Creators", "Content");
});
modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Subscription", b =>
{
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<Guid>("CreatorId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("CreatedBy", "CreatorId");
b.HasIndex("CreatorId");
b.ToTable("Subscriptions", "Content");
});
modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Content", b =>
{
b.HasOne("Hutopy.Web.Features.Contents.Data.Creator", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Creator");
});
modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Creator", b =>
{
b.OwnsOne("Hutopy.Web.Features.Contents.Data.About", "About", b1 =>
{
b1.Property<Guid>("CreatorId")
.HasColumnType("uuid");
b1.Property<string>("Description")
.HasMaxLength(2048)
.HasColumnType("character varying(2048)");
b1.Property<string>("Title")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.HasKey("CreatorId");
b1.ToTable("Creators", "Content");
b1.WithOwner()
.HasForeignKey("CreatorId");
});
b.OwnsOne("Hutopy.Web.Features.Contents.Data.ProfileColors", "ProfileColors", b1 =>
{
b1.Property<Guid>("CreatorId")
.HasColumnType("uuid");
b1.Property<string>("Accent")
.HasMaxLength(9)
.HasColumnType("character varying(9)");
b1.Property<string>("BannerBottom")
.HasMaxLength(9)
.HasColumnType("character varying(9)");
b1.Property<string>("BannerTop")
.HasMaxLength(9)
.HasColumnType("character varying(9)");
b1.Property<string>("Menu")
.HasMaxLength(9)
.HasColumnType("character varying(9)");
b1.HasKey("CreatorId");
b1.ToTable("ProfileColors", "Content");
b1.WithOwner()
.HasForeignKey("CreatorId");
});
b.OwnsOne("Hutopy.Web.Features.Contents.Data.Socials", "Socials", b1 =>
{
b1.Property<Guid>("CreatorId")
.HasColumnType("uuid");
b1.Property<string>("FacebookUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("InstagramUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("LinkedInUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("RedditUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("TikTokUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("WebsiteUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("XUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("YoutubeUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.HasKey("CreatorId");
b1.ToTable("Socials", "Content");
b1.WithOwner()
.HasForeignKey("CreatorId");
});
b.OwnsOne("Hutopy.Web.Features.Contents.Data.StoredDataUrls", "StoredDataUrls", b1 =>
{
b1.Property<Guid>("CreatorId")
.HasColumnType("uuid");
b1.Property<string>("BannerPictureUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("ProfilePictureUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.HasKey("CreatorId");
b1.ToTable("StoredDataUrls", "Content");
b1.WithOwner()
.HasForeignKey("CreatorId");
});
b.Navigation("About")
.IsRequired();
b.Navigation("ProfileColors")
.IsRequired();
b.Navigation("Socials")
.IsRequired();
b.Navigation("StoredDataUrls")
.IsRequired();
});
modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Subscription", b =>
{
b.HasOne("Hutopy.Web.Features.Contents.Data.Creator", "Creator")
.WithMany()
.HasForeignKey("CreatorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Creator");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -1,191 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Hutopy.Web.Features.Contents.Migrations
{
/// <inheritdoc />
public partial class Initial : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: "Content");
migrationBuilder.CreateTable(
name: "Creators",
schema: "Content",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
CreatedBy = table.Column<Guid>(type: "uuid", 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),
About_Title = 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 =>
{
table.PrimaryKey("PK_Creators", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Contents",
schema: "Content",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
CreatedBy = table.Column<Guid>(type: "uuid", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, defaultValueSql: "CURRENT_TIMESTAMP"),
Title = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
Description = table.Column<string>(type: "character varying(2048)", maxLength: 2048, nullable: false),
Urls = table.Column<string[]>(type: "text[]", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Contents", x => x.Id);
table.ForeignKey(
name: "FK_Contents_Creators_CreatedBy",
column: x => x.CreatedBy,
principalSchema: "Content",
principalTable: "Creators",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ProfileColors",
schema: "Content",
columns: table => new
{
CreatorId = table.Column<Guid>(type: "uuid", nullable: false),
BannerTop = table.Column<string>(type: "character varying(9)", maxLength: 9, nullable: true),
BannerBottom = table.Column<string>(type: "character varying(9)", maxLength: 9, nullable: true),
Accent = table.Column<string>(type: "character varying(9)", maxLength: 9, nullable: true),
Menu = table.Column<string>(type: "character varying(9)", maxLength: 9, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ProfileColors", x => x.CreatorId);
table.ForeignKey(
name: "FK_ProfileColors_Creators_CreatorId",
column: x => x.CreatorId,
principalSchema: "Content",
principalTable: "Creators",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Socials",
schema: "Content",
columns: table => new
{
CreatorId = table.Column<Guid>(type: "uuid", nullable: false),
FacebookUrl = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
InstagramUrl = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
XUrl = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
LinkedInUrl = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
TikTokUrl = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
YoutubeUrl = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
RedditUrl = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
WebsiteUrl = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Socials", x => x.CreatorId);
table.ForeignKey(
name: "FK_Socials_Creators_CreatorId",
column: x => x.CreatorId,
principalSchema: "Content",
principalTable: "Creators",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "StoredDataUrls",
schema: "Content",
columns: table => new
{
CreatorId = table.Column<Guid>(type: "uuid", nullable: false),
BannerPictureUrl = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true),
ProfilePictureUrl = table.Column<string>(type: "character varying(255)", maxLength: 255, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_StoredDataUrls", x => x.CreatorId);
table.ForeignKey(
name: "FK_StoredDataUrls_Creators_CreatorId",
column: x => x.CreatorId,
principalSchema: "Content",
principalTable: "Creators",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Subscriptions",
schema: "Content",
columns: table => new
{
CreatedBy = table.Column<Guid>(type: "uuid", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Subscriptions", x => new { x.CreatedBy, x.CreatorId });
table.ForeignKey(
name: "FK_Subscriptions_Creators_CreatorId",
column: x => x.CreatorId,
principalSchema: "Content",
principalTable: "Creators",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Contents_CreatedBy",
schema: "Content",
table: "Contents",
column: "CreatedBy");
migrationBuilder.CreateIndex(
name: "IX_Subscriptions_CreatorId",
schema: "Content",
table: "Subscriptions",
column: "CreatorId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Contents",
schema: "Content");
migrationBuilder.DropTable(
name: "ProfileColors",
schema: "Content");
migrationBuilder.DropTable(
name: "Socials",
schema: "Content");
migrationBuilder.DropTable(
name: "StoredDataUrls",
schema: "Content");
migrationBuilder.DropTable(
name: "Subscriptions",
schema: "Content");
migrationBuilder.DropTable(
name: "Creators",
schema: "Content");
}
}
}

View File

@@ -1,255 +0,0 @@
// <auto-generated />
using System;
using Hutopy.Web.Features.Contents.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Hutopy.Web.Features.Contents.Migrations
{
[DbContext(typeof(ContentDbContext))]
partial class ContentDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("Content")
.HasAnnotation("ProductVersion", "8.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Content", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("CreatedAt")
.ValueGeneratedOnAdd()
.HasColumnType("timestamp with time zone")
.HasDefaultValueSql("CURRENT_TIMESTAMP");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Description")
.IsRequired()
.HasMaxLength(2048)
.HasColumnType("character varying(2048)");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string[]>("Urls")
.HasColumnType("text[]");
b.HasKey("Id");
b.HasIndex("CreatedBy");
b.ToTable("Contents", "Content");
});
modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Creator", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b.HasKey("Id");
b.ToTable("Creators", "Content");
});
modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Subscription", b =>
{
b.Property<Guid>("CreatedBy")
.HasColumnType("uuid");
b.Property<Guid>("CreatorId")
.HasColumnType("uuid");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("CreatedBy", "CreatorId");
b.HasIndex("CreatorId");
b.ToTable("Subscriptions", "Content");
});
modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Content", b =>
{
b.HasOne("Hutopy.Web.Features.Contents.Data.Creator", "Creator")
.WithMany()
.HasForeignKey("CreatedBy")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Creator");
});
modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Creator", b =>
{
b.OwnsOne("Hutopy.Web.Features.Contents.Data.About", "About", b1 =>
{
b1.Property<Guid>("CreatorId")
.HasColumnType("uuid");
b1.Property<string>("Description")
.HasMaxLength(2048)
.HasColumnType("character varying(2048)");
b1.Property<string>("Title")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.HasKey("CreatorId");
b1.ToTable("Creators", "Content");
b1.WithOwner()
.HasForeignKey("CreatorId");
});
b.OwnsOne("Hutopy.Web.Features.Contents.Data.ProfileColors", "ProfileColors", b1 =>
{
b1.Property<Guid>("CreatorId")
.HasColumnType("uuid");
b1.Property<string>("Accent")
.HasMaxLength(9)
.HasColumnType("character varying(9)");
b1.Property<string>("BannerBottom")
.HasMaxLength(9)
.HasColumnType("character varying(9)");
b1.Property<string>("BannerTop")
.HasMaxLength(9)
.HasColumnType("character varying(9)");
b1.Property<string>("Menu")
.HasMaxLength(9)
.HasColumnType("character varying(9)");
b1.HasKey("CreatorId");
b1.ToTable("ProfileColors", "Content");
b1.WithOwner()
.HasForeignKey("CreatorId");
});
b.OwnsOne("Hutopy.Web.Features.Contents.Data.Socials", "Socials", b1 =>
{
b1.Property<Guid>("CreatorId")
.HasColumnType("uuid");
b1.Property<string>("FacebookUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("InstagramUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("LinkedInUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("RedditUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("TikTokUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("WebsiteUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("XUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("YoutubeUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.HasKey("CreatorId");
b1.ToTable("Socials", "Content");
b1.WithOwner()
.HasForeignKey("CreatorId");
});
b.OwnsOne("Hutopy.Web.Features.Contents.Data.StoredDataUrls", "StoredDataUrls", b1 =>
{
b1.Property<Guid>("CreatorId")
.HasColumnType("uuid");
b1.Property<string>("BannerPictureUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.Property<string>("ProfilePictureUrl")
.HasMaxLength(255)
.HasColumnType("character varying(255)");
b1.HasKey("CreatorId");
b1.ToTable("StoredDataUrls", "Content");
b1.WithOwner()
.HasForeignKey("CreatorId");
});
b.Navigation("About")
.IsRequired();
b.Navigation("ProfileColors")
.IsRequired();
b.Navigation("Socials")
.IsRequired();
b.Navigation("StoredDataUrls")
.IsRequired();
});
modelBuilder.Entity("Hutopy.Web.Features.Contents.Data.Subscription", b =>
{
b.HasOne("Hutopy.Web.Features.Contents.Data.Creator", "Creator")
.WithMany()
.HasForeignKey("CreatorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Creator");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -43,7 +43,7 @@ internal class TestDataSeeder(
{ {
var creatorUser = await CreateUserAsync( var creatorUser = await CreateUserAsync(
creator.Name, creator.Name,
creator.StoredDataUrls.ProfilePictureUrl, creator.Images.Logo,
Roles.Creator); Roles.Creator);
creator.Id = creatorUser.Id; creator.Id = creatorUser.Id;
@@ -200,10 +200,10 @@ internal class TestDataSeeder(
FacebookUrl = "https://www.facebook.com/Hutopy", FacebookUrl = "https://www.facebook.com/Hutopy",
InstagramUrl = "https://www.instagram.com/hutopy.inc/" InstagramUrl = "https://www.instagram.com/hutopy.inc/"
}, },
StoredDataUrls = new() Images = new()
{ {
BannerPictureUrl = "/images/usersmedia/HutopyProfile/banners/banner01.png", Banner = "/images/usersmedia/HutopyProfile/banners/banner01.png",
ProfilePictureUrl = "/images/usersmedia/HutopyProfile/profilepictures/profileHutopyProfile01.png" Logo = "/images/usersmedia/HutopyProfile/profilepictures/profileHutopyProfile01.png"
} }
}; };
@@ -227,10 +227,10 @@ internal class TestDataSeeder(
LinkedInUrl = "https://www.linkedin.com/in/mickael-simard-96079a90/", LinkedInUrl = "https://www.linkedin.com/in/mickael-simard-96079a90/",
WebsiteUrl = "https://www.arps.ca/" WebsiteUrl = "https://www.arps.ca/"
}, },
StoredDataUrls = new() Images = new()
{ {
BannerPictureUrl = "/images/usersmedia/ARPS/banners/bannerARPS01.png", Banner = "/images/usersmedia/ARPS/banners/bannerARPS01.png",
ProfilePictureUrl = "/images/usersmedia/ARPS/profilepictures/profileARPS.png" Logo = "/images/usersmedia/ARPS/profilepictures/profileARPS.png"
} }
}; };
@@ -252,10 +252,10 @@ internal class TestDataSeeder(
FacebookUrl = "https://www.facebook.com/chloegestionmedias", FacebookUrl = "https://www.facebook.com/chloegestionmedias",
InstagramUrl = "https://www.instagram.com/chloe.photo_gms", InstagramUrl = "https://www.instagram.com/chloe.photo_gms",
}, },
StoredDataUrls = new() Images = new()
{ {
BannerPictureUrl = "/images/usersmedia/chloebeaugrand/banners/bannerChloeBeaugrand01.png", Banner = "/images/usersmedia/chloebeaugrand/banners/bannerChloeBeaugrand01.png",
ProfilePictureUrl = "/images/usersmedia/chloebeaugrand/profilepictures/profileChloeBeaugrand01.png" Logo = "/images/usersmedia/chloebeaugrand/profilepictures/profileChloeBeaugrand01.png"
} }
}; };
@@ -279,10 +279,10 @@ internal class TestDataSeeder(
InstagramUrl = "https://www.instagram.com/guillaumeaime/", InstagramUrl = "https://www.instagram.com/guillaumeaime/",
TikTokUrl = "https://www.tiktok.com/@guillaumeaime" TikTokUrl = "https://www.tiktok.com/@guillaumeaime"
}, },
StoredDataUrls = new() Images = new()
{ {
BannerPictureUrl = "/images/usersmedia/guillaumeMousseau/banners/bannerGuillaumeMousseau01.png", Banner = "/images/usersmedia/guillaumeMousseau/banners/bannerGuillaumeMousseau01.png",
ProfilePictureUrl = Logo =
"/images/usersmedia/guillaumeMousseau/profilepictures/profileGuillaumeMousseau01.png" "/images/usersmedia/guillaumeMousseau/profilepictures/profileGuillaumeMousseau01.png"
} }
}; };
@@ -307,10 +307,10 @@ internal class TestDataSeeder(
InstagramUrl = "https://www.instagram.com/guillaumeaime/", InstagramUrl = "https://www.instagram.com/guillaumeaime/",
WebsiteUrl = "https://fondationleffet.ca/" WebsiteUrl = "https://fondationleffet.ca/"
}, },
StoredDataUrls = new() Images = new()
{ {
BannerPictureUrl = "/images/usersmedia/leffet/banners/banner02.png", Banner = "/images/usersmedia/leffet/banners/banner02.png",
ProfilePictureUrl = "/images/usersmedia/leffet/profilepictures/leffetProfile01.png" Logo = "/images/usersmedia/leffet/profilepictures/leffetProfile01.png"
} }
}; };
@@ -333,10 +333,10 @@ 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() Images = new()
{ {
BannerPictureUrl = "/images/usersmedia/mathieuCaron/banners/bannerMathieuCaron01.png", Banner = "/images/usersmedia/mathieuCaron/banners/bannerMathieuCaron01.png",
ProfilePictureUrl = "/images/usersmedia/mathieuCaron/profilepictures/profileMathieuCaron01.png" Logo = "/images/usersmedia/mathieuCaron/profilepictures/profileMathieuCaron01.png"
} }
}; };