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( name: "Date", table: "Impregnations", type: "date", nullable: false, oldClrType: typeof(DateTime), oldType: "timestamp with time zone"); migrationBuilder.AddColumn( 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( name: "ClientId", table: "Projects", type: "integer", nullable: true); migrationBuilder.AlterColumn( 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"); } } }