Files
Kansan/KanSan.Base/Migrations/20200317101951_Güteschutzverlinkungen.cs
2020-03-17 14:26:11 +01:00

367 lines
15 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace KanSan.Base.Migrations
{
public partial class Güteschutzverlinkungen : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_KurzlinerSanierung_Schaeden_SchadPositionID",
table: "KurzlinerSanierung");
migrationBuilder.DropTable(
name: "HutprofilSanierung");
migrationBuilder.DropPrimaryKey(
name: "PK_KurzlinerSanierung",
table: "KurzlinerSanierung");
migrationBuilder.RenameTable(
name: "KurzlinerSanierung",
newName: "GueteschutzProtokoll");
migrationBuilder.RenameIndex(
name: "IX_KurzlinerSanierung_SchadPositionID",
table: "GueteschutzProtokoll",
newName: "IX_GueteschutzProtokoll_SchadPositionID");
migrationBuilder.AddColumn<int>(
name: "GueteschutzProtokolID",
table: "Taetigkeiten",
nullable: true);
migrationBuilder.AlterColumn<double>(
name: "PackerDruckEnde",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(double),
oldType: "double precision");
migrationBuilder.AlterColumn<double>(
name: "PackerDruckAnfang",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(double),
oldType: "double precision");
migrationBuilder.AlterColumn<DateTime>(
name: "MischZeit",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<double>(
name: "Lang",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(double),
oldType: "double precision");
migrationBuilder.AlterColumn<int>(
name: "Flaechengewicht",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(int),
oldType: "integer");
migrationBuilder.AlterColumn<bool>(
name: "FixierungAufPacker",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(bool),
oldType: "boolean");
migrationBuilder.AlterColumn<DateTime>(
name: "EntlueftenPacker",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<double>(
name: "Breit",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(double),
oldType: "double precision");
migrationBuilder.AlterColumn<bool>(
name: "Auffaelligkeit",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(bool),
oldType: "boolean");
migrationBuilder.AlterColumn<DateTime>(
name: "AnpressenPacker",
table: "GueteschutzProtokoll",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AddColumn<string>(
name: "Discriminator",
table: "GueteschutzProtokoll",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<bool>(
name: "InnenBeschichtung",
table: "GueteschutzProtokoll",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "RohrDN",
table: "GueteschutzProtokoll",
nullable: true);
migrationBuilder.AddColumn<double>(
name: "SeitenKanalDruckAnfang",
table: "GueteschutzProtokoll",
nullable: true);
migrationBuilder.AddColumn<double>(
name: "SeitenKanalDruckEnde",
table: "GueteschutzProtokoll",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Winkel",
table: "GueteschutzProtokoll",
nullable: true);
migrationBuilder.AddPrimaryKey(
name: "PK_GueteschutzProtokoll",
table: "GueteschutzProtokoll",
column: "ID");
migrationBuilder.CreateIndex(
name: "IX_Taetigkeiten_GueteschutzProtokolID",
table: "Taetigkeiten",
column: "GueteschutzProtokolID");
migrationBuilder.AddForeignKey(
name: "FK_GueteschutzProtokoll_Schaeden_SchadPositionID",
table: "GueteschutzProtokoll",
column: "SchadPositionID",
principalTable: "Schaeden",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_Taetigkeiten_GueteschutzProtokoll_GueteschutzProtokolID",
table: "Taetigkeiten",
column: "GueteschutzProtokolID",
principalTable: "GueteschutzProtokoll",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_GueteschutzProtokoll_Schaeden_SchadPositionID",
table: "GueteschutzProtokoll");
migrationBuilder.DropForeignKey(
name: "FK_Taetigkeiten_GueteschutzProtokoll_GueteschutzProtokolID",
table: "Taetigkeiten");
migrationBuilder.DropIndex(
name: "IX_Taetigkeiten_GueteschutzProtokolID",
table: "Taetigkeiten");
migrationBuilder.DropPrimaryKey(
name: "PK_GueteschutzProtokoll",
table: "GueteschutzProtokoll");
migrationBuilder.DropColumn(
name: "GueteschutzProtokolID",
table: "Taetigkeiten");
migrationBuilder.DropColumn(
name: "Discriminator",
table: "GueteschutzProtokoll");
migrationBuilder.DropColumn(
name: "InnenBeschichtung",
table: "GueteschutzProtokoll");
migrationBuilder.DropColumn(
name: "RohrDN",
table: "GueteschutzProtokoll");
migrationBuilder.DropColumn(
name: "SeitenKanalDruckAnfang",
table: "GueteschutzProtokoll");
migrationBuilder.DropColumn(
name: "SeitenKanalDruckEnde",
table: "GueteschutzProtokoll");
migrationBuilder.DropColumn(
name: "Winkel",
table: "GueteschutzProtokoll");
migrationBuilder.RenameTable(
name: "GueteschutzProtokoll",
newName: "KurzlinerSanierung");
migrationBuilder.RenameIndex(
name: "IX_GueteschutzProtokoll_SchadPositionID",
table: "KurzlinerSanierung",
newName: "IX_KurzlinerSanierung_SchadPositionID");
migrationBuilder.AlterColumn<double>(
name: "Lang",
table: "KurzlinerSanierung",
type: "double precision",
nullable: false,
oldClrType: typeof(double),
oldNullable: true);
migrationBuilder.AlterColumn<double>(
name: "Breit",
table: "KurzlinerSanierung",
type: "double precision",
nullable: false,
oldClrType: typeof(double),
oldNullable: true);
migrationBuilder.AlterColumn<double>(
name: "PackerDruckEnde",
table: "KurzlinerSanierung",
type: "double precision",
nullable: false,
oldClrType: typeof(double),
oldNullable: true);
migrationBuilder.AlterColumn<double>(
name: "PackerDruckAnfang",
table: "KurzlinerSanierung",
type: "double precision",
nullable: false,
oldClrType: typeof(double),
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "MischZeit",
table: "KurzlinerSanierung",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "Flaechengewicht",
table: "KurzlinerSanierung",
type: "integer",
nullable: false,
oldClrType: typeof(int),
oldNullable: true);
migrationBuilder.AlterColumn<bool>(
name: "FixierungAufPacker",
table: "KurzlinerSanierung",
type: "boolean",
nullable: false,
oldClrType: typeof(bool),
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "EntlueftenPacker",
table: "KurzlinerSanierung",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldNullable: true);
migrationBuilder.AlterColumn<bool>(
name: "Auffaelligkeit",
table: "KurzlinerSanierung",
type: "boolean",
nullable: false,
oldClrType: typeof(bool),
oldNullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "AnpressenPacker",
table: "KurzlinerSanierung",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldNullable: true);
migrationBuilder.AddPrimaryKey(
name: "PK_KurzlinerSanierung",
table: "KurzlinerSanierung",
column: "ID");
migrationBuilder.CreateTable(
name: "HutprofilSanierung",
columns: table => new
{
ID = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
AnpressenPacker = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
Auffaelligkeit = table.Column<bool>(type: "boolean", nullable: false),
AussenTemp = table.Column<int>(type: "integer", nullable: false),
Bericht = table.Column<bool>(type: "boolean", nullable: false),
Dichtheit = table.Column<bool>(type: "boolean", nullable: false),
EntlueftenPacker = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
Film = table.Column<bool>(type: "boolean", nullable: false),
FixierungAufPacker = table.Column<bool>(type: "boolean", nullable: false),
Flaechengewicht = table.Column<int>(type: "integer", nullable: false),
GuidNr = table.Column<Guid>(type: "uuid", nullable: false),
HarzMaterialArt = table.Column<string>(type: "text", nullable: true),
HarzmaterialHersteller = table.Column<string>(type: "text", nullable: true),
InnenBeschichtung = table.Column<bool>(type: "boolean", nullable: false),
KanalTemp = table.Column<int>(type: "integer", nullable: false),
KompACharge = table.Column<string>(type: "text", nullable: true),
KompBCharge = table.Column<string>(type: "text", nullable: true),
MischZeit = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
PackerDruckAnfang = table.Column<double>(type: "double precision", nullable: false),
PackerDruckEnde = table.Column<double>(type: "double precision", nullable: false),
RohrDN = table.Column<string>(type: "text", nullable: true),
SchadPositionID = table.Column<int>(type: "integer", nullable: true),
SeitenKanalDruckAnfang = table.Column<double>(type: "double precision", nullable: false),
SeitenKanalDruckEnde = table.Column<double>(type: "double precision", nullable: false),
Sichtkontrolle = table.Column<bool>(type: "boolean", nullable: false),
TraegerCharge = table.Column<string>(type: "text", nullable: true),
TraegerHersteller = table.Column<string>(type: "text", nullable: true),
TraegerKurzliner = table.Column<string>(type: "text", nullable: true),
Video = table.Column<bool>(type: "boolean", nullable: false),
Wetter = table.Column<int>(type: "integer", nullable: false),
Winkel = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_HutprofilSanierung", x => x.ID);
table.ForeignKey(
name: "FK_HutprofilSanierung_Schaeden_SchadPositionID",
column: x => x.SchadPositionID,
principalTable: "Schaeden",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_HutprofilSanierung_SchadPositionID",
table: "HutprofilSanierung",
column: "SchadPositionID");
migrationBuilder.AddForeignKey(
name: "FK_KurzlinerSanierung_Schaeden_SchadPositionID",
table: "KurzlinerSanierung",
column: "SchadPositionID",
principalTable: "Schaeden",
principalColumn: "ID",
onDelete: ReferentialAction.Restrict);
}
}
}