Hold on Subscriptions

This commit is contained in:
Jonathan Bourdon
2024-08-03 22:56:12 -04:00
parent 2b30e1a03c
commit 0340904847
7 changed files with 103 additions and 9 deletions

View File

@@ -8,6 +8,10 @@ public class ContentDbContext(
{
public const string SchemaName = "Content";
public DbSet<Content> Contents => Set<Content>();
public DbSet<Creator> Creators => Set<Creator>();
public DbSet<Subscription> Subscriptions => Set<Subscription>();
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasDefaultSchema("Content");
@@ -24,21 +28,20 @@ public class ContentDbContext(
modelBuilder
.Entity<Creator>()
.OwnsOne<SocialNetworks>(x => x.SocialNetworks);
.OwnsOne<SocialNetworks>(x => x.SocialNetworks)
.ToTable(nameof(SocialNetworks));
modelBuilder
.Entity<Creator>()
.OwnsOne<ProfileColors>(x => x.ProfileColors);
.OwnsOne<ProfileColors>(x => x.ProfileColors)
.ToTable(nameof(ProfileColors));
modelBuilder
.Entity<Creator>()
.OwnsOne<StoredDataUrls>(x => x.StoredDataUrls);
.OwnsOne<StoredDataUrls>(x => x.StoredDataUrls)
.ToTable(nameof(StoredDataUrls));
}
public DbSet<Content> Contents { get; init; } = null!;
public DbSet<Creator> Creators { get; init; } = null!;
public async Task<Creator?> FindByCreatorAliasAsync(
string creatorAlias,
CancellationToken cancellationToken = default)

View File

@@ -0,0 +1,9 @@
namespace Hutopy.Web.Features.Contents.Data;
public class Subscription
{
public Guid Id { get; init; }
public Guid CreatorId { get; init; }
public Guid CreatedBy { get; init; }
public DateTimeOffset CreatedAt { get; init; }
}