Leistungsverzeichnis hinzugefügt

This commit is contained in:
Husky
2020-04-13 18:17:07 +02:00
parent 4f6da68fe2
commit d655f98681
38 changed files with 2482 additions and 38 deletions

View File

@@ -0,0 +1,77 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace KanSan.Base.Migrations
{
public partial class LeistungsverzeichnisUpdate : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Taetigkeiten_LeitungsverzeichnisPositionen_Leitungsverzeich~",
table: "Taetigkeiten");
migrationBuilder.DropTable(
name: "LeitungsverzeichnisPositionen");
migrationBuilder.CreateTable(
name: "LeistungsverzeichnisPositionen",
columns: table => new
{
ID = table.Column<int>(nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
GuidNr = table.Column<Guid>(nullable: false),
Positionsnummer = table.Column<string>(nullable: true),
Beschreibung = table.Column<string>(nullable: true),
Einheit = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_LeistungsverzeichnisPositionen", x => x.ID);
});
migrationBuilder.AddForeignKey(
name: "FK_Taetigkeiten_LeistungsverzeichnisPositionen_Leitungsverzeic~",
table: "Taetigkeiten",
column: "LeitungsverzeichnisPositionID",
principalTable: "LeistungsverzeichnisPositionen",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Taetigkeiten_LeistungsverzeichnisPositionen_Leitungsverzeic~",
table: "Taetigkeiten");
migrationBuilder.DropTable(
name: "LeistungsverzeichnisPositionen");
migrationBuilder.CreateTable(
name: "LeitungsverzeichnisPositionen",
columns: table => new
{
ID = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Beschreibung = table.Column<string>(type: "text", nullable: true),
Einheit = table.Column<string>(type: "text", nullable: true),
GuidNr = table.Column<Guid>(type: "uuid", nullable: false),
Positionsnummer = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_LeitungsverzeichnisPositionen", x => x.ID);
});
migrationBuilder.AddForeignKey(
name: "FK_Taetigkeiten_LeitungsverzeichnisPositionen_Leitungsverzeich~",
table: "Taetigkeiten",
column: "LeitungsverzeichnisPositionID",
principalTable: "LeitungsverzeichnisPositionen",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
}
}
}