Torma Kristóf
8347b10401
All checks were successful
continuous-integration/drone/push Build is passing
45 lines
1.4 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|