using Microsoft.EntityFrameworkCore.Migrations;

namespace HanyadikHetVan.Data.Migrations
{
    public partial class AddOwnerToWeeklyTimeSpan : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "OwnerId",
                table: "WeeklyTimeSpans",
                type: "nvarchar(450)",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_WeeklyTimeSpans_OwnerId",
                table: "WeeklyTimeSpans",
                column: "OwnerId");

            migrationBuilder.AddForeignKey(
                name: "FK_WeeklyTimeSpans_AspNetUsers_OwnerId",
                table: "WeeklyTimeSpans",
                column: "OwnerId",
                principalTable: "AspNetUsers",
                principalColumn: "Id",
                onDelete: ReferentialAction.Restrict);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_WeeklyTimeSpans_AspNetUsers_OwnerId",
                table: "WeeklyTimeSpans");

            migrationBuilder.DropIndex(
                name: "IX_WeeklyTimeSpans_OwnerId",
                table: "WeeklyTimeSpans");

            migrationBuilder.DropColumn(
                name: "OwnerId",
                table: "WeeklyTimeSpans");
        }
    }
}
