using Microsoft.EntityFrameworkCore.Migrations; namespace DaSaSo.EntityFramework.Migrations { public partial class ProjectReferenzAdded : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Projects_Clients_ClientId", table: "Projects"); migrationBuilder.DropForeignKey( name: "FK_SewerObjects_Buildingsites_BuildingSiteId", table: "SewerObjects"); migrationBuilder.AlterColumn( name: "StreetName", table: "SewerObjects", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "PointTo", table: "SewerObjects", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "PointFrom", table: "SewerObjects", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "ObjektName", table: "SewerObjects", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "BuildingSiteId", table: "SewerObjects", type: "integer", nullable: true, oldClrType: typeof(int), oldType: "integer"); migrationBuilder.AlterColumn( name: "Name", table: "Projects", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "ClientId", table: "Projects", type: "integer", nullable: true, oldClrType: typeof(int), oldType: "integer"); migrationBuilder.AlterColumn( name: "Street", table: "Clients", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "Postcode", table: "Clients", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "LastName", table: "Clients", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "Firstname", table: "Clients", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "Country", table: "Clients", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "Country", table: "Buildingsites", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "ContactPerson", table: "Buildingsites", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "BuildingSiteNumber", table: "Buildingsites", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AddForeignKey( name: "FK_Projects_Clients_ClientId", table: "Projects", column: "ClientId", principalTable: "Clients", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_SewerObjects_Buildingsites_BuildingSiteId", table: "SewerObjects", column: "BuildingSiteId", principalTable: "Buildingsites", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Projects_Clients_ClientId", table: "Projects"); migrationBuilder.DropForeignKey( name: "FK_SewerObjects_Buildingsites_BuildingSiteId", table: "SewerObjects"); migrationBuilder.AlterColumn( name: "StreetName", table: "SewerObjects", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "PointTo", table: "SewerObjects", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "PointFrom", table: "SewerObjects", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "ObjektName", table: "SewerObjects", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "BuildingSiteId", table: "SewerObjects", type: "integer", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "integer", oldNullable: true); migrationBuilder.AlterColumn( name: "Name", table: "Projects", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "ClientId", table: "Projects", type: "integer", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "integer", oldNullable: true); migrationBuilder.AlterColumn( name: "Street", table: "Clients", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "Postcode", table: "Clients", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "LastName", table: "Clients", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "Firstname", table: "Clients", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "Country", table: "Clients", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "Country", table: "Buildingsites", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "ContactPerson", table: "Buildingsites", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "BuildingSiteNumber", table: "Buildingsites", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AddForeignKey( name: "FK_Projects_Clients_ClientId", table: "Projects", column: "ClientId", principalTable: "Clients", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_SewerObjects_Buildingsites_BuildingSiteId", table: "SewerObjects", column: "BuildingSiteId", principalTable: "Buildingsites", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }