93 lines
2.9 KiB
C#
93 lines
2.9 KiB
C#
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");
|
|
}
|
|
}
|
|
}
|