78 lines
3.3 KiB
C#
78 lines
3.3 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|