hanyadikhetvan-dotnethf/HanyadikHetVan/Data/Migrations/20210518232039_AddOwnerToWeeklyTimeSpan.cs
Torma Kristóf 8347b10401
All checks were successful
continuous-integration/drone/push Build is passing
big day behind me
2021-05-19 04:33:53 +02:00

45 lines
1.4 KiB
C#

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");
}
}
}