49 lines
1.3 KiB
C#
49 lines
1.3 KiB
C#
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace ServiceStationsDataBaseImplement.Migrations
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
public partial class Migration02 : Migration
|
|||
|
{
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.AddColumn<int>(
|
|||
|
name: "_taskId",
|
|||
|
table: "Works",
|
|||
|
type: "int",
|
|||
|
nullable: true);
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_Works__taskId",
|
|||
|
table: "Works",
|
|||
|
column: "_taskId");
|
|||
|
|
|||
|
migrationBuilder.AddForeignKey(
|
|||
|
name: "FK_Works_Tasks__taskId",
|
|||
|
table: "Works",
|
|||
|
column: "_taskId",
|
|||
|
principalTable: "Tasks",
|
|||
|
principalColumn: "Id");
|
|||
|
}
|
|||
|
|
|||
|
/// <inheritdoc />
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropForeignKey(
|
|||
|
name: "FK_Works_Tasks__taskId",
|
|||
|
table: "Works");
|
|||
|
|
|||
|
migrationBuilder.DropIndex(
|
|||
|
name: "IX_Works__taskId",
|
|||
|
table: "Works");
|
|||
|
|
|||
|
migrationBuilder.DropColumn(
|
|||
|
name: "_taskId",
|
|||
|
table: "Works");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|