using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace FSI.Prj.Mgt.Data.Migrations
{
    /// <inheritdoc />
    public partial class InitProjects10 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "ProjectId",
                table: "Organizations",
                type: "int",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_Organizations_ProjectId",
                table: "Organizations",
                column: "ProjectId");

            migrationBuilder.AddForeignKey(
                name: "FK_Organizations_Projects_ProjectId",
                table: "Organizations",
                column: "ProjectId",
                principalTable: "Projects",
                principalColumn: "Id");
        }

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

            migrationBuilder.DropIndex(
                name: "IX_Organizations_ProjectId",
                table: "Organizations");

            migrationBuilder.DropColumn(
                name: "ProjectId",
                table: "Organizations");
        }
    }
}
