Post featured record

This commit is contained in:
2025-08-12 12:17:26 +08:00
parent 05c6d67c03
commit 616491e6d8
6 changed files with 2055 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,51 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using NodaTime;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
/// <inheritdoc />
public partial class AddPostFeaturedRecord : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "post_featured_records",
columns: table => new
{
id = table.Column<Guid>(type: "uuid", nullable: false),
post_id = table.Column<Guid>(type: "uuid", nullable: false),
featured_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true),
social_credits = table.Column<int>(type: "integer", nullable: false),
created_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
updated_at = table.Column<Instant>(type: "timestamp with time zone", nullable: false),
deleted_at = table.Column<Instant>(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("pk_post_featured_records", x => x.id);
table.ForeignKey(
name: "fk_post_featured_records_posts_post_id",
column: x => x.post_id,
principalTable: "posts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "ix_post_featured_records_post_id",
table: "post_featured_records",
column: "post_id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "post_featured_records");
}
}
}

View File

@@ -724,6 +724,46 @@ namespace DysonNetwork.Sphere.Migrations
b.ToTable("post_collections", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostFeaturedRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid")
.HasColumnName("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<Instant?>("FeaturedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("featured_at");
b.Property<Guid>("PostId")
.HasColumnType("uuid")
.HasColumnName("post_id");
b.Property<int>("SocialCredits")
.HasColumnType("integer")
.HasColumnName("social_credits");
b.Property<Instant>("UpdatedAt")
.HasColumnType("timestamp with time zone")
.HasColumnName("updated_at");
b.HasKey("Id")
.HasName("pk_post_featured_records");
b.HasIndex("PostId")
.HasDatabaseName("ix_post_featured_records_post_id");
b.ToTable("post_featured_records", (string)null);
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b =>
{
b.Property<Guid>("Id")
@@ -1637,6 +1677,18 @@ namespace DysonNetwork.Sphere.Migrations
b.Navigation("Publisher");
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostFeaturedRecord", b =>
{
b.HasOne("DysonNetwork.Sphere.Post.Post", "Post")
.WithMany()
.HasForeignKey("PostId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_post_featured_records_posts_post_id");
b.Navigation("Post");
});
modelBuilder.Entity("DysonNetwork.Sphere.Post.PostReaction", b =>
{
b.HasOne("DysonNetwork.Sphere.Post.Post", "Post")