using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MainProject.Migrations
{
///
public partial class AlterTableUserMaxLengthIndexes : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn(
name: "Username",
table: "Users",
type: "nvarchar(200)",
maxLength: 200,
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn(
name: "LastName",
table: "Users",
type: "nvarchar(200)",
maxLength: 200,
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn(
name: "Guid",
table: "Users",
type: "nvarchar(45)",
maxLength: 45,
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn(
name: "FirstName",
table: "Users",
type: "nvarchar(200)",
maxLength: 200,
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn(
name: "Email",
table: "Users",
type: "nvarchar(200)",
maxLength: 200,
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AddColumn(
name: "IsTestUser",
table: "Users",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AlterColumn(
name: "Guid",
table: "Role",
type: "nvarchar(45)",
maxLength: 45,
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.CreateIndex(
name: "IX_Email",
table: "Users",
column: "Email");
migrationBuilder.CreateIndex(
name: "IX_IsDeleted_Guid",
table: "Users",
columns: new[] { "IsDeleted", "Guid" },
filter: "[IsDeleted] = 0");
migrationBuilder.CreateIndex(
name: "IX_Username",
table: "Users",
column: "Username");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_Email",
table: "Users");
migrationBuilder.DropIndex(
name: "IX_IsDeleted_Guid",
table: "Users");
migrationBuilder.DropIndex(
name: "IX_Username",
table: "Users");
migrationBuilder.DropColumn(
name: "IsTestUser",
table: "Users");
migrationBuilder.AlterColumn(
name: "Username",
table: "Users",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(200)",
oldMaxLength: 200);
migrationBuilder.AlterColumn(
name: "LastName",
table: "Users",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(200)",
oldMaxLength: 200);
migrationBuilder.AlterColumn(
name: "Guid",
table: "Users",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(45)",
oldMaxLength: 45);
migrationBuilder.AlterColumn(
name: "FirstName",
table: "Users",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(200)",
oldMaxLength: 200);
migrationBuilder.AlterColumn(
name: "Email",
table: "Users",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(200)",
oldMaxLength: 200);
migrationBuilder.AlterColumn(
name: "Guid",
table: "Role",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(45)",
oldMaxLength: 45);
}
}
}