using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Watcher.Migrations
{
    /// <inheritdoc />
    public partial class AddContainerServerNavigation : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateIndex(
                name: "IX_Containers_ServerId",
                table: "Containers",
                column: "ServerId");

            migrationBuilder.AddForeignKey(
                name: "FK_Containers_Servers_ServerId",
                table: "Containers",
                column: "ServerId",
                principalTable: "Servers",
                principalColumn: "Id",
                onDelete: ReferentialAction.Cascade);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_Containers_Servers_ServerId",
                table: "Containers");

            migrationBuilder.DropIndex(
                name: "IX_Containers_ServerId",
                table: "Containers");
        }
    }
}
