Clients sind nicht mehr als oberste Prio

This commit is contained in:
HuskyTeufel
2021-11-01 16:10:46 +01:00
parent d4da9fd0da
commit ee46751fa6
16 changed files with 513 additions and 57 deletions

View File

@@ -0,0 +1,92 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DaSaSo.EntityFramework.Migrations
{
public partial class RemoveClientAsDomain : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Projects_Clients_ClientId",
table: "Projects");
migrationBuilder.DropIndex(
name: "IX_Projects_ClientId",
table: "Projects");
migrationBuilder.DropColumn(
name: "ClientId",
table: "Projects");
migrationBuilder.AlterColumn<DateOnly>(
name: "Date",
table: "Impregnations",
type: "date",
nullable: false,
oldClrType: typeof(DateTime),
oldType: "timestamp with time zone");
migrationBuilder.AddColumn<int>(
name: "ClientId",
table: "Buildingsites",
type: "integer",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Buildingsites_ClientId",
table: "Buildingsites",
column: "ClientId");
migrationBuilder.AddForeignKey(
name: "FK_Buildingsites_Clients_ClientId",
table: "Buildingsites",
column: "ClientId",
principalTable: "Clients",
principalColumn: "Id");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Buildingsites_Clients_ClientId",
table: "Buildingsites");
migrationBuilder.DropIndex(
name: "IX_Buildingsites_ClientId",
table: "Buildingsites");
migrationBuilder.DropColumn(
name: "ClientId",
table: "Buildingsites");
migrationBuilder.AddColumn<int>(
name: "ClientId",
table: "Projects",
type: "integer",
nullable: true);
migrationBuilder.AlterColumn<DateTime>(
name: "Date",
table: "Impregnations",
type: "timestamp with time zone",
nullable: false,
oldClrType: typeof(DateOnly),
oldType: "date");
migrationBuilder.CreateIndex(
name: "IX_Projects_ClientId",
table: "Projects",
column: "ClientId");
migrationBuilder.AddForeignKey(
name: "FK_Projects_Clients_ClientId",
table: "Projects",
column: "ClientId",
principalTable: "Clients",
principalColumn: "Id");
}
}
}