using System; using Microsoft.EntityFrameworkCore.Migrations; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace agologum_api.Migrations { /// public partial class UseIdentityPlatform : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "Name", table: "Users"); migrationBuilder.DropColumn( name: "Role", table: "Users"); migrationBuilder.AlterColumn( name: "PasswordHash", table: "Users", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "Email", table: "Users", type: "text", nullable: true, oldClrType: typeof(string), oldType: "text"); migrationBuilder.AlterColumn( name: "Id", table: "Users", type: "text", nullable: false, oldClrType: typeof(int), oldType: "integer") .OldAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); migrationBuilder.AddColumn( name: "AccessFailedCount", table: "Users", type: "integer", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "ConcurrencyStamp", table: "Users", type: "text", nullable: true); migrationBuilder.AddColumn( name: "EmailConfirmed", table: "Users", type: "boolean", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "LockoutEnabled", table: "Users", type: "boolean", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "LockoutEnd", table: "Users", type: "timestamp with time zone", nullable: true); migrationBuilder.AddColumn( name: "NormalizedEmail", table: "Users", type: "text", nullable: true); migrationBuilder.AddColumn( name: "NormalizedUserName", table: "Users", type: "text", nullable: true); migrationBuilder.AddColumn( name: "PhoneNumber", table: "Users", type: "text", nullable: true); migrationBuilder.AddColumn( name: "PhoneNumberConfirmed", table: "Users", type: "boolean", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "SecurityStamp", table: "Users", type: "text", nullable: true); migrationBuilder.AddColumn( name: "TwoFactorEnabled", table: "Users", type: "boolean", nullable: false, defaultValue: false); migrationBuilder.AddColumn( name: "UserName", table: "Users", type: "text", nullable: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "AccessFailedCount", table: "Users"); migrationBuilder.DropColumn( name: "ConcurrencyStamp", table: "Users"); migrationBuilder.DropColumn( name: "EmailConfirmed", table: "Users"); migrationBuilder.DropColumn( name: "LockoutEnabled", table: "Users"); migrationBuilder.DropColumn( name: "LockoutEnd", table: "Users"); migrationBuilder.DropColumn( name: "NormalizedEmail", table: "Users"); migrationBuilder.DropColumn( name: "NormalizedUserName", table: "Users"); migrationBuilder.DropColumn( name: "PhoneNumber", table: "Users"); migrationBuilder.DropColumn( name: "PhoneNumberConfirmed", table: "Users"); migrationBuilder.DropColumn( name: "SecurityStamp", table: "Users"); migrationBuilder.DropColumn( name: "TwoFactorEnabled", table: "Users"); migrationBuilder.DropColumn( name: "UserName", table: "Users"); migrationBuilder.AlterColumn( name: "PasswordHash", table: "Users", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "Email", table: "Users", type: "text", nullable: false, defaultValue: "", oldClrType: typeof(string), oldType: "text", oldNullable: true); migrationBuilder.AlterColumn( name: "Id", table: "Users", type: "integer", nullable: false, oldClrType: typeof(string), oldType: "text") .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); migrationBuilder.AddColumn( name: "Name", table: "Users", type: "text", nullable: false, defaultValue: ""); migrationBuilder.AddColumn( name: "Role", table: "Users", type: "text", nullable: false, defaultValue: ""); } } }