Renames SocialNetworks to Socials

This commit is contained in:
Jonathan Bourdon
2024-08-06 00:14:40 -04:00
parent b2583738f5
commit 14bc4ce69b
9 changed files with 31 additions and 31 deletions

View File

@@ -44,8 +44,8 @@ public class ContentDbContext(
modelBuilder modelBuilder
.Entity<Creator>() .Entity<Creator>()
.OwnsOne<SocialNetworks>(x => x.SocialNetworks) .OwnsOne<Socials>(x => x.Socials)
.ToTable(nameof(SocialNetworks)); .ToTable(nameof(Socials));
modelBuilder modelBuilder
.Entity<Creator>() .Entity<Creator>()

View File

@@ -10,7 +10,7 @@ public class Creator
[MaxLength(255)] public string Name { get; set; } = null!; [MaxLength(255)] public string Name { get; set; } = null!;
public About About { get; set; } = new(); public About About { get; set; } = new();
public SocialNetworks SocialNetworks { 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 StoredDataUrls StoredDataUrls { get; set; } = new();
} }
@@ -29,7 +29,7 @@ public class ProfileColors
[MaxLength(9)] public string? Menu { get; set; } [MaxLength(9)] public string? Menu { get; set; }
} }
public class SocialNetworks public class Socials
{ {
[MaxLength(255)] public string? FacebookUrl { get; set; } [MaxLength(255)] public string? FacebookUrl { get; set; }
[MaxLength(255)] public string? InstagramUrl { get; set; } [MaxLength(255)] public string? InstagramUrl { get; set; }

View File

@@ -34,14 +34,14 @@ public class ChangeSocialsHandler(
c => c.Id == request.CreatorId, c => c.Id == request.CreatorId,
cancellationToken: ct); cancellationToken: ct);
creator.SocialNetworks.FacebookUrl = request.FacebookUrl; creator.Socials.FacebookUrl = request.FacebookUrl;
creator.SocialNetworks.InstagramUrl = request.InstagramUrl; creator.Socials.InstagramUrl = request.InstagramUrl;
creator.SocialNetworks.XUrl = request.XUrl; creator.Socials.XUrl = request.XUrl;
creator.SocialNetworks.LinkedInUrl = request.LinkedInUrl; creator.Socials.LinkedInUrl = request.LinkedInUrl;
creator.SocialNetworks.TikTokUrl = request.TikTokUrl; creator.Socials.TikTokUrl = request.TikTokUrl;
creator.SocialNetworks.YoutubeUrl = request.YoutubeUrl; creator.Socials.YoutubeUrl = request.YoutubeUrl;
creator.SocialNetworks.RedditUrl = request.RedditUrl; creator.Socials.RedditUrl = request.RedditUrl;
creator.SocialNetworks.WebsiteUrl = request.WebsiteUrl; creator.Socials.WebsiteUrl = request.WebsiteUrl;
await context.SaveChangesAsync(ct); await context.SaveChangesAsync(ct);

View File

@@ -61,7 +61,7 @@ public class GetCreatorByAliasHandler(
CreatedAt = creator.CreatedAt, CreatedAt = creator.CreatedAt,
Name = creator.Name, Name = creator.Name,
About = creator.About, About = creator.About,
SocialNetworks = creator.SocialNetworks, Socials = creator.Socials,
ProfileColors = creator.ProfileColors, ProfileColors = creator.ProfileColors,
StoredDataUrls = creator.StoredDataUrls, StoredDataUrls = creator.StoredDataUrls,
SubscriberCount = subscriberCount, SubscriberCount = subscriberCount,

View File

@@ -9,7 +9,7 @@ public class CreatorModel
public DateTimeOffset CreatedAt { get; set; } public DateTimeOffset CreatedAt { get; set; }
public string Name { get; set; } public string Name { get; set; }
public About About { get; set; } public About About { get; set; }
public SocialNetworks SocialNetworks { get; set; } public Socials Socials { get; set; }
public ProfileColors ProfileColors { get; set; } public ProfileColors ProfileColors { get; set; }
public StoredDataUrls StoredDataUrls { get; set; } public StoredDataUrls StoredDataUrls { get; set; }
public int SubscriberCount { get; set; } public int SubscriberCount { get; set; }

View File

@@ -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("20240805012309_Initial")] [Migration("20240806041040_Initial")]
partial class Initial partial class Initial
{ {
/// <inheritdoc /> /// <inheritdoc />
@@ -163,7 +163,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
.HasForeignKey("CreatorId"); .HasForeignKey("CreatorId");
}); });
b.OwnsOne("Hutopy.Web.Features.Contents.Data.SocialNetworks", "SocialNetworks", b1 => b.OwnsOne("Hutopy.Web.Features.Contents.Data.Socials", "Socials", b1 =>
{ {
b1.Property<Guid>("CreatorId") b1.Property<Guid>("CreatorId")
.HasColumnType("uuid"); .HasColumnType("uuid");
@@ -202,7 +202,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
b1.HasKey("CreatorId"); b1.HasKey("CreatorId");
b1.ToTable("SocialNetworks", "Content"); b1.ToTable("Socials", "Content");
b1.WithOwner() b1.WithOwner()
.HasForeignKey("CreatorId"); .HasForeignKey("CreatorId");
@@ -235,7 +235,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
b.Navigation("ProfileColors") b.Navigation("ProfileColors")
.IsRequired(); .IsRequired();
b.Navigation("SocialNetworks") b.Navigation("Socials")
.IsRequired(); .IsRequired();
b.Navigation("StoredDataUrls") b.Navigation("StoredDataUrls")

View File

@@ -79,7 +79,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
}); });
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "SocialNetworks", name: "Socials",
schema: "Content", schema: "Content",
columns: table => new columns: table => new
{ {
@@ -95,9 +95,9 @@ namespace Hutopy.Web.Features.Contents.Migrations
}, },
constraints: table => constraints: table =>
{ {
table.PrimaryKey("PK_SocialNetworks", x => x.CreatorId); table.PrimaryKey("PK_Socials", x => x.CreatorId);
table.ForeignKey( table.ForeignKey(
name: "FK_SocialNetworks_Creators_CreatorId", name: "FK_Socials_Creators_CreatorId",
column: x => x.CreatorId, column: x => x.CreatorId,
principalSchema: "Content", principalSchema: "Content",
principalTable: "Creators", principalTable: "Creators",
@@ -172,7 +172,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
schema: "Content"); schema: "Content");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "SocialNetworks", name: "Socials",
schema: "Content"); schema: "Content");
migrationBuilder.DropTable( migrationBuilder.DropTable(

View File

@@ -160,7 +160,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
.HasForeignKey("CreatorId"); .HasForeignKey("CreatorId");
}); });
b.OwnsOne("Hutopy.Web.Features.Contents.Data.SocialNetworks", "SocialNetworks", b1 => b.OwnsOne("Hutopy.Web.Features.Contents.Data.Socials", "Socials", b1 =>
{ {
b1.Property<Guid>("CreatorId") b1.Property<Guid>("CreatorId")
.HasColumnType("uuid"); .HasColumnType("uuid");
@@ -199,7 +199,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
b1.HasKey("CreatorId"); b1.HasKey("CreatorId");
b1.ToTable("SocialNetworks", "Content"); b1.ToTable("Socials", "Content");
b1.WithOwner() b1.WithOwner()
.HasForeignKey("CreatorId"); .HasForeignKey("CreatorId");
@@ -232,7 +232,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
b.Navigation("ProfileColors") b.Navigation("ProfileColors")
.IsRequired(); .IsRequired();
b.Navigation("SocialNetworks") b.Navigation("Socials")
.IsRequired(); .IsRequired();
b.Navigation("StoredDataUrls") b.Navigation("StoredDataUrls")

View File

@@ -193,7 +193,7 @@ internal class TestDataSeeder(
{ {
BannerTop = "#A30E79", BannerBottom = "#6B0065", Accent = "#23393B", Menu = "#53B93B", BannerTop = "#A30E79", BannerBottom = "#6B0065", Accent = "#23393B", Menu = "#53B93B",
}, },
SocialNetworks = Socials =
new() new()
{ {
XUrl = "https://twitter.com/Hutopyinc", XUrl = "https://twitter.com/Hutopyinc",
@@ -218,7 +218,7 @@ internal class TestDataSeeder(
}, },
ProfileColors = ProfileColors =
new() { BannerTop = "#231F20", BannerBottom = "#231F20", Accent = "#272526", Menu = "#FFFFFF" }, new() { BannerTop = "#231F20", BannerBottom = "#231F20", Accent = "#272526", Menu = "#FFFFFF" },
SocialNetworks = new() Socials = new()
{ {
FacebookUrl = "https://www.facebook.com/arps.company", FacebookUrl = "https://www.facebook.com/arps.company",
InstagramUrl = "https://www.instagram.com/arps.co/", InstagramUrl = "https://www.instagram.com/arps.co/",
@@ -246,7 +246,7 @@ internal class TestDataSeeder(
{ {
BannerTop = "#231F20", BannerBottom = "#272526", Accent = "#231F20", Menu = "#231F20", BannerTop = "#231F20", BannerBottom = "#272526", Accent = "#231F20", Menu = "#231F20",
}, },
SocialNetworks = Socials =
new() new()
{ {
FacebookUrl = "https://www.facebook.com/chloegestionmedias", FacebookUrl = "https://www.facebook.com/chloegestionmedias",
@@ -272,7 +272,7 @@ internal class TestDataSeeder(
{ {
BannerTop = "#0BAAB2", BannerBottom = "#006D77", Accent = "#CC6F91", Menu = "#CC6F91", BannerTop = "#0BAAB2", BannerBottom = "#006D77", Accent = "#CC6F91", Menu = "#CC6F91",
}, },
SocialNetworks = Socials =
new() new()
{ {
FacebookUrl = "https://www.facebook.com/GuillaumeMousseau222", FacebookUrl = "https://www.facebook.com/GuillaumeMousseau222",
@@ -300,7 +300,7 @@ internal class TestDataSeeder(
{ {
BannerTop = "#CC6F91", BannerBottom = "#FBC702", Accent = "#FBC702", Menu = "#FBC702", BannerTop = "#CC6F91", BannerBottom = "#FBC702", Accent = "#FBC702", Menu = "#FBC702",
}, },
SocialNetworks = Socials =
new() new()
{ {
FacebookUrl = "https://www.facebook.com/Hutopy", FacebookUrl = "https://www.facebook.com/Hutopy",
@@ -327,7 +327,7 @@ internal class TestDataSeeder(
{ {
BannerTop = "#101B49", BannerBottom = "#698FE7", Accent = "#1D1D1B", Menu = "#1D1D1B", BannerTop = "#101B49", BannerBottom = "#698FE7", Accent = "#1D1D1B", Menu = "#1D1D1B",
}, },
SocialNetworks = Socials =
new() new()
{ {
FacebookUrl = "https://www.facebook.com/MathieuCaronPro/", FacebookUrl = "https://www.facebook.com/MathieuCaronPro/",