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
.Entity<Creator>()
.OwnsOne<SocialNetworks>(x => x.SocialNetworks)
.ToTable(nameof(SocialNetworks));
.OwnsOne<Socials>(x => x.Socials)
.ToTable(nameof(Socials));
modelBuilder
.Entity<Creator>()

View File

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

View File

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

View File

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

View File

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

View File

@@ -12,7 +12,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace Hutopy.Web.Features.Contents.Migrations
{
[DbContext(typeof(ContentDbContext))]
[Migration("20240805012309_Initial")]
[Migration("20240806041040_Initial")]
partial class Initial
{
/// <inheritdoc />
@@ -163,7 +163,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
.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")
.HasColumnType("uuid");
@@ -202,7 +202,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
b1.HasKey("CreatorId");
b1.ToTable("SocialNetworks", "Content");
b1.ToTable("Socials", "Content");
b1.WithOwner()
.HasForeignKey("CreatorId");
@@ -235,7 +235,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
b.Navigation("ProfileColors")
.IsRequired();
b.Navigation("SocialNetworks")
b.Navigation("Socials")
.IsRequired();
b.Navigation("StoredDataUrls")

View File

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

View File

@@ -160,7 +160,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
.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")
.HasColumnType("uuid");
@@ -199,7 +199,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
b1.HasKey("CreatorId");
b1.ToTable("SocialNetworks", "Content");
b1.ToTable("Socials", "Content");
b1.WithOwner()
.HasForeignKey("CreatorId");
@@ -232,7 +232,7 @@ namespace Hutopy.Web.Features.Contents.Migrations
b.Navigation("ProfileColors")
.IsRequired();
b.Navigation("SocialNetworks")
b.Navigation("Socials")
.IsRequired();
b.Navigation("StoredDataUrls")