Organization publishers, subscriptions to publishers

This commit is contained in:
2025-05-12 21:48:16 +08:00
parent b20bc3c443
commit b275f06061
14 changed files with 6197 additions and 19 deletions

View File

@ -1575,6 +1575,10 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("integer")
.HasColumnName("publisher_type");
b.Property<long?>("RealmId")
.HasColumnType("bigint")
.HasColumnName("realm_id");
b.Property<Instant>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
@ -1595,6 +1599,9 @@ namespace DysonNetwork.Sphere.Migrations
b.HasIndex("PictureId")
.HasDatabaseName("ix_publishers_picture_id");
b.HasIndex("RealmId")
.HasDatabaseName("ix_publishers_realm_id");
b.ToTable("publishers", (string)null);
});
@ -1637,6 +1644,53 @@ namespace DysonNetwork.Sphere.Migrations
b.ToTable("publisher_members", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherSubscription", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<long>("AccountId")
.HasColumnType("bigint")
.HasColumnName("account_id");
b.Property<Instant>("CreatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("created_at");
b.Property<Instant?>("DeletedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("deleted_at");
b.Property<long>("PublisherId")
.HasColumnType("bigint")
.HasColumnName("publisher_id");
b.Property<int>("Status")
.HasColumnType("integer")
.HasColumnName("status");
b.Property<int>("Tier")
.HasColumnType("integer")
.HasColumnName("tier");
b.Property<Instant>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.HasKey("Id")
.HasName("pk_publisher_subscriptions");
b.HasIndex("AccountId")
.HasDatabaseName("ix_publisher_subscriptions_account_id");
b.HasIndex("PublisherId")
.HasDatabaseName("ix_publisher_subscriptions_publisher_id");
b.ToTable("publisher_subscriptions", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b =>
{
b.Property<long>("Id")
@ -2442,11 +2496,18 @@ namespace DysonNetwork.Sphere.Migrations
.HasForeignKey("PictureId")
.HasConstraintName("fk_publishers_files_picture_id");
b.HasOne("DysonNetwork.Sphere.Realm.Realm", "Realm")
.WithMany()
.HasForeignKey("RealmId")
.HasConstraintName("fk_publishers_realms_realm_id");
b.Navigation("Account");
b.Navigation("Background");
b.Navigation("Picture");
b.Navigation("Realm");
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherMember", b =>
@ -2470,6 +2531,27 @@ namespace DysonNetwork.Sphere.Migrations
b.Navigation("Publisher");
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PublisherSubscription", b =>
{
b.HasOne("DysonNetwork.Sphere.Account.Account", "Account")
.WithMany()
.HasForeignKey("AccountId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_publisher_subscriptions_accounts_account_id");
b.HasOne("DysonNetwork.Sphere.Post.Publisher", "Publisher")
.WithMany("Subscriptions")
.HasForeignKey("PublisherId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_publisher_subscriptions_publishers_publisher_id");
b.Navigation("Account");
b.Navigation("Publisher");
});
modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b =>
{
b.HasOne("DysonNetwork.Sphere.Account.Account", "Account")
@ -2676,6 +2758,8 @@ namespace DysonNetwork.Sphere.Migrations
b.Navigation("Members");
b.Navigation("Posts");
b.Navigation("Subscriptions");
});
modelBuilder.Entity("DysonNetwork.Sphere.Realm.Realm", b =>