45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
namespace DaSaSo.EntityFramework.Migrations
|
|
{
|
|
public partial class LineraddedToSewer : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "PipeLinerId",
|
|
table: "SewerObjects",
|
|
type: "integer",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_SewerObjects_PipeLinerId",
|
|
table: "SewerObjects",
|
|
column: "PipeLinerId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_SewerObjects_PipeLiners_PipeLinerId",
|
|
table: "SewerObjects",
|
|
column: "PipeLinerId",
|
|
principalTable: "PipeLiners",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_SewerObjects_PipeLiners_PipeLinerId",
|
|
table: "SewerObjects");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_SewerObjects_PipeLinerId",
|
|
table: "SewerObjects");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "PipeLinerId",
|
|
table: "SewerObjects");
|
|
}
|
|
}
|
|
}
|