using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Project.Web.Migrations { /// public partial class Zwoelfte : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_USER_ROLE_RoleId", schema: "dbo", table: "USER"); migrationBuilder.DropIndex( name: "IX_USER_RoleId", schema: "dbo", table: "USER"); migrationBuilder.DropColumn( name: "RoleId", schema: "dbo", table: "USER"); migrationBuilder.AlterColumn( name: "ROLE_ID", schema: "dbo", table: "USER", type: "int", nullable: false, defaultValue: 0, oldClrType: typeof(int), oldType: "int", oldNullable: true); migrationBuilder.AddColumn( name: "ROLE", schema: "dbo", table: "USER", type: "int", nullable: true); migrationBuilder.CreateIndex( name: "IX_USER_ROLE_ID", schema: "dbo", table: "USER", column: "ROLE_ID"); migrationBuilder.AddForeignKey( name: "FK_USER_ROLE_ROLE_ID", schema: "dbo", table: "USER", column: "ROLE_ID", principalSchema: "dbo", principalTable: "ROLE", principalColumn: "ID", onDelete: ReferentialAction.Cascade); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_USER_ROLE_ROLE_ID", schema: "dbo", table: "USER"); migrationBuilder.DropIndex( name: "IX_USER_ROLE_ID", schema: "dbo", table: "USER"); migrationBuilder.DropColumn( name: "ROLE", schema: "dbo", table: "USER"); migrationBuilder.AlterColumn( name: "ROLE_ID", schema: "dbo", table: "USER", type: "int", nullable: true, oldClrType: typeof(int), oldType: "int"); migrationBuilder.AddColumn( name: "RoleId", schema: "dbo", table: "USER", type: "int", nullable: false, defaultValue: 0); migrationBuilder.CreateIndex( name: "IX_USER_RoleId", schema: "dbo", table: "USER", column: "RoleId"); migrationBuilder.AddForeignKey( name: "FK_USER_ROLE_RoleId", schema: "dbo", table: "USER", column: "RoleId", principalSchema: "dbo", principalTable: "ROLE", principalColumn: "ID", onDelete: ReferentialAction.Cascade); } } }