using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace StandManager.Infrastructure.Migrations { /// public partial class UserApp : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropPrimaryKey( name: "PK_ApplicationUsers", table: "ApplicationUsers"); migrationBuilder.RenameTable( name: "ApplicationUsers", newName: "AspNetUsers"); migrationBuilder.AlterColumn( name: "UserName", table: "AspNetUsers", type: "nvarchar(256)", maxLength: 256, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(max)", oldNullable: true); migrationBuilder.AlterColumn( name: "NormalizedUserName", table: "AspNetUsers", type: "nvarchar(256)", maxLength: 256, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(max)", oldNullable: true); migrationBuilder.AlterColumn( name: "NormalizedEmail", table: "AspNetUsers", type: "nvarchar(256)", maxLength: 256, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(max)", oldNullable: true); migrationBuilder.AlterColumn( name: "Email", table: "AspNetUsers", type: "nvarchar(256)", maxLength: 256, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(max)", oldNullable: true); migrationBuilder.AddPrimaryKey( name: "PK_AspNetUsers", table: "AspNetUsers", column: "Id"); migrationBuilder.CreateTable( name: "AspNetUserClaims", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), UserId = table.Column(type: "nvarchar(450)", nullable: false), ClaimType = table.Column(type: "nvarchar(max)", nullable: true), ClaimValue = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetUserClaims", x => x.Id); table.ForeignKey( name: "FK_AspNetUserClaims_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AspNetUserLogins", columns: table => new { LoginProvider = table.Column(type: "nvarchar(450)", nullable: false), ProviderKey = table.Column(type: "nvarchar(450)", nullable: false), ProviderDisplayName = table.Column(type: "nvarchar(max)", nullable: true), UserId = table.Column(type: "nvarchar(450)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey }); table.ForeignKey( name: "FK_AspNetUserLogins_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "AspNetUserTokens", columns: table => new { UserId = table.Column(type: "nvarchar(450)", nullable: false), LoginProvider = table.Column(type: "nvarchar(450)", nullable: false), Name = table.Column(type: "nvarchar(450)", nullable: false), Value = table.Column(type: "nvarchar(max)", nullable: true) }, constraints: table => { table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); table.ForeignKey( name: "FK_AspNetUserTokens_AspNetUsers_UserId", column: x => x.UserId, principalTable: "AspNetUsers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "EmailIndex", table: "AspNetUsers", column: "NormalizedEmail"); migrationBuilder.CreateIndex( name: "UserNameIndex", table: "AspNetUsers", column: "NormalizedUserName", unique: true, filter: "[NormalizedUserName] IS NOT NULL"); migrationBuilder.CreateIndex( name: "IX_AspNetUserClaims_UserId", table: "AspNetUserClaims", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_AspNetUserLogins_UserId", table: "AspNetUserLogins", column: "UserId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "AspNetUserClaims"); migrationBuilder.DropTable( name: "AspNetUserLogins"); migrationBuilder.DropTable( name: "AspNetUserTokens"); migrationBuilder.DropPrimaryKey( name: "PK_AspNetUsers", table: "AspNetUsers"); migrationBuilder.DropIndex( name: "EmailIndex", table: "AspNetUsers"); migrationBuilder.DropIndex( name: "UserNameIndex", table: "AspNetUsers"); migrationBuilder.RenameTable( name: "AspNetUsers", newName: "ApplicationUsers"); migrationBuilder.AlterColumn( name: "UserName", table: "ApplicationUsers", type: "nvarchar(max)", nullable: true, oldClrType: typeof(string), oldType: "nvarchar(256)", oldMaxLength: 256, oldNullable: true); migrationBuilder.AlterColumn( name: "NormalizedUserName", table: "ApplicationUsers", type: "nvarchar(max)", nullable: true, oldClrType: typeof(string), oldType: "nvarchar(256)", oldMaxLength: 256, oldNullable: true); migrationBuilder.AlterColumn( name: "NormalizedEmail", table: "ApplicationUsers", type: "nvarchar(max)", nullable: true, oldClrType: typeof(string), oldType: "nvarchar(256)", oldMaxLength: 256, oldNullable: true); migrationBuilder.AlterColumn( name: "Email", table: "ApplicationUsers", type: "nvarchar(max)", nullable: true, oldClrType: typeof(string), oldType: "nvarchar(256)", oldMaxLength: 256, oldNullable: true); migrationBuilder.AddPrimaryKey( name: "PK_ApplicationUsers", table: "ApplicationUsers", column: "Id"); } } }