166 lines
5.2 KiB
C#
166 lines
5.2 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace MainProject.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class AlterTableUserMaxLengthIndexes : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "Username",
|
|
table: "Users",
|
|
type: "nvarchar(200)",
|
|
maxLength: 200,
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(max)");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "LastName",
|
|
table: "Users",
|
|
type: "nvarchar(200)",
|
|
maxLength: 200,
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(max)");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "Guid",
|
|
table: "Users",
|
|
type: "nvarchar(45)",
|
|
maxLength: 45,
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(max)");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "FirstName",
|
|
table: "Users",
|
|
type: "nvarchar(200)",
|
|
maxLength: 200,
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(max)");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "Email",
|
|
table: "Users",
|
|
type: "nvarchar(200)",
|
|
maxLength: 200,
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(max)");
|
|
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "IsTestUser",
|
|
table: "Users",
|
|
type: "bit",
|
|
nullable: false,
|
|
defaultValue: false);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
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");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
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<string>(
|
|
name: "Username",
|
|
table: "Users",
|
|
type: "nvarchar(max)",
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(200)",
|
|
oldMaxLength: 200);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "LastName",
|
|
table: "Users",
|
|
type: "nvarchar(max)",
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(200)",
|
|
oldMaxLength: 200);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "Guid",
|
|
table: "Users",
|
|
type: "nvarchar(max)",
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(45)",
|
|
oldMaxLength: 45);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "FirstName",
|
|
table: "Users",
|
|
type: "nvarchar(max)",
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(200)",
|
|
oldMaxLength: 200);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "Email",
|
|
table: "Users",
|
|
type: "nvarchar(max)",
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(200)",
|
|
oldMaxLength: 200);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "Guid",
|
|
table: "Role",
|
|
type: "nvarchar(max)",
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(45)",
|
|
oldMaxLength: 45);
|
|
}
|
|
}
|
|
}
|