Files
DaSaSo/DaSaSo.EntityFramework/Migrations/20210928140403_SewerPointsAdded.cs
2021-09-28 17:52:17 +02:00

119 lines
4.0 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DaSaSo.EntityFramework.Migrations
{
public partial class SewerPointsAdded : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_SewerObjects_SewerPoint_PunktObenId",
table: "SewerObjects");
migrationBuilder.DropForeignKey(
name: "FK_SewerObjects_SewerPoint_PunktUntenId",
table: "SewerObjects");
migrationBuilder.DropPrimaryKey(
name: "PK_SewerPoint",
table: "SewerPoint");
migrationBuilder.RenameTable(
name: "SewerPoint",
newName: "SewerPoints");
migrationBuilder.AlterColumn<DateTime>(
name: "Date",
table: "PipeLiners",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "Date",
table: "Impregnations",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp without time zone");
migrationBuilder.AddPrimaryKey(
name: "PK_SewerPoints",
table: "SewerPoints",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_SewerObjects_SewerPoints_PunktObenId",
table: "SewerObjects",
column: "PunktObenId",
principalTable: "SewerPoints",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_SewerObjects_SewerPoints_PunktUntenId",
table: "SewerObjects",
column: "PunktUntenId",
principalTable: "SewerPoints",
principalColumn: "Id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_SewerObjects_SewerPoints_PunktObenId",
table: "SewerObjects");
migrationBuilder.DropForeignKey(
name: "FK_SewerObjects_SewerPoints_PunktUntenId",
table: "SewerObjects");
migrationBuilder.DropPrimaryKey(
name: "PK_SewerPoints",
table: "SewerPoints");
migrationBuilder.RenameTable(
name: "SewerPoints",
newName: "SewerPoint");
migrationBuilder.AlterColumn<DateTime>(
name: "Date",
table: "PipeLiners",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AlterColumn<DateTime>(
name: "Date",
table: "Impregnations",
type: "timestamp without time zone",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AddPrimaryKey(
name: "PK_SewerPoint",
table: "SewerPoint",
column: "Id");
migrationBuilder.AddForeignKey(
name: "FK_SewerObjects_SewerPoint_PunktObenId",
table: "SewerObjects",
column: "PunktObenId",
principalTable: "SewerPoint",
principalColumn: "Id");
migrationBuilder.AddForeignKey(
name: "FK_SewerObjects_SewerPoint_PunktUntenId",
table: "SewerObjects",
column: "PunktUntenId",
principalTable: "SewerPoint",
principalColumn: "Id");
}
}
}