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