using Microsoft.EntityFrameworkCore.Migrations;
using NodaTime;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
    /// 
    public partial class AddPostFeaturedRecord : Migration
    {
        /// 
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "post_featured_records",
                columns: table => new
                {
                    id = table.Column(type: "uuid", nullable: false),
                    post_id = table.Column(type: "uuid", nullable: false),
                    featured_at = table.Column(type: "timestamp with time zone", nullable: true),
                    social_credits = table.Column(type: "integer", nullable: false),
                    created_at = table.Column(type: "timestamp with time zone", nullable: false),
                    updated_at = table.Column(type: "timestamp with time zone", nullable: false),
                    deleted_at = table.Column(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");
        }
        /// 
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "post_featured_records");
        }
    }
}