Files
Kansan/KanSan.Base/Migrations/20200411101442_LeistungsverzeichnisReferenz.cs
2020-04-13 18:17:07 +02:00

56 lines
2.3 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace KanSan.Base.Migrations
{
public partial class LeistungsverzeichnisReferenz : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "LeistungsverzeichnisBaustellen",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
GuidNr = table.Column<Guid>(nullable: false),
BaustelleID = table.Column<int>(nullable: true),
LVPositionID = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_LeistungsverzeichnisBaustellen", x => x.ID);
table.ForeignKey(
name: "FK_LeistungsverzeichnisBaustellen_Baustelle_BaustelleID",
column: x => x.BaustelleID,
principalTable: "Baustelle",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_LeistungsverzeichnisBaustellen_LeistungsverzeichnisPosition~",
column: x => x.LVPositionID,
principalTable: "LeistungsverzeichnisPositionen",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_LeistungsverzeichnisBaustellen_BaustelleID",
table: "LeistungsverzeichnisBaustellen",
column: "BaustelleID");
migrationBuilder.CreateIndex(
name: "IX_LeistungsverzeichnisBaustellen_LVPositionID",
table: "LeistungsverzeichnisBaustellen",
column: "LVPositionID");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "LeistungsverzeichnisBaustellen");
}
}
}