using Microsoft.EntityFrameworkCore.Migrations;
using NodaTime;
#nullable disable
namespace DysonNetwork.Sphere.Migrations
{
    /// 
    public partial class AddWebFeedSubscription : Migration
    {
        /// 
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "web_feed_subscriptions",
                columns: table => new
                {
                    id = table.Column(type: "uuid", nullable: false),
                    feed_id = table.Column(type: "uuid", nullable: false),
                    account_id = table.Column(type: "uuid", 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_web_feed_subscriptions", x => x.id);
                    table.ForeignKey(
                        name: "fk_web_feed_subscriptions_web_feeds_feed_id",
                        column: x => x.feed_id,
                        principalTable: "web_feeds",
                        principalColumn: "id",
                        onDelete: ReferentialAction.Cascade);
                });
            migrationBuilder.CreateIndex(
                name: "ix_web_feed_subscriptions_feed_id",
                table: "web_feed_subscriptions",
                column: "feed_id");
        }
        /// 
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "web_feed_subscriptions");
        }
    }
}