🗃️ Add post award database

This commit is contained in:
2025-09-05 00:24:54 +08:00
parent 9c078db564
commit 5e328509bd
3 changed files with 2264 additions and 0 deletions

View File

@@ -529,6 +529,10 @@ namespace DysonNetwork.Sphere.Migrations
.HasColumnType("jsonb")
.HasColumnName("attachments");
b.Property<decimal>("AwardedScore")
.HasColumnType("numeric")
.HasColumnName("awarded_score");
b.Property<string>("Content")
.HasColumnType("text")
.HasColumnName("content");
@@ -659,6 +663,55 @@ namespace DysonNetwork.Sphere.Migrations
b.ToTable("posts", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostAward", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("id");
b.Property<Guid>("AccountId")
.HasColumnType("uuid")
.HasColumnName("account_id");
b.Property<decimal>("Amount")
.HasColumnType("numeric")
.HasColumnName("amount");
b.Property<int>("Attitude")
.HasColumnType("integer")
.HasColumnName("attitude");
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<string>("Message")
.HasMaxLength(4096)
.HasColumnType("character varying(4096)")
.HasColumnName("message");
b.Property<Guid>("PostId")
.HasColumnType("uuid")
.HasColumnName("post_id");
b.Property<Instant>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.HasKey("Id")
.HasName("pk_post_awards");
b.HasIndex("PostId")
.HasDatabaseName("ix_post_awards_post_id");
b.ToTable("post_awards", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategory", b =>
{
b.Property<Guid>("Id")
@@ -1770,6 +1823,18 @@ namespace DysonNetwork.Sphere.Migrations
b.Navigation("RepliedPost");
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostAward", b =>
{
b.HasOne("DysonNetwork.Sphere.Post.Post", "Post")
.WithMany("Awards")
.HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_post_awards_posts_post_id");
b.Navigation("Post");
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostCategorySubscription", b =>
{
b.HasOne("DysonNetwork.Sphere.Post.PostCategory", "Category")
@@ -2021,6 +2086,8 @@ namespace DysonNetwork.Sphere.Migrations
modelBuilder.Entity("DysonNetwork.Sphere.Post.Post", b =>
{
b.Navigation("Awards");
b.Navigation("Reactions");
});