54 lines
1.7 KiB
C#
54 lines
1.7 KiB
C#
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
namespace app.Data.Migrations
|
|||
|
{
|
|||
|
public partial class _2021_03_14 : Migration
|
|||
|
{
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropIndex(
|
|||
|
name: "IX_Users_Discriminator_Name",
|
|||
|
table: "Users");
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<string>(
|
|||
|
name: "Name",
|
|||
|
table: "Users",
|
|||
|
nullable: true,
|
|||
|
oldClrType: typeof(string),
|
|||
|
oldType: "varchar(255) CHARACTER SET utf8mb4",
|
|||
|
oldNullable: true);
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<string>(
|
|||
|
name: "Discriminator",
|
|||
|
table: "Users",
|
|||
|
nullable: false,
|
|||
|
oldClrType: typeof(string),
|
|||
|
oldType: "varchar(255) CHARACTER SET utf8mb4");
|
|||
|
}
|
|||
|
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.AlterColumn<string>(
|
|||
|
name: "Name",
|
|||
|
table: "Users",
|
|||
|
type: "varchar(255) CHARACTER SET utf8mb4",
|
|||
|
nullable: true,
|
|||
|
oldClrType: typeof(string),
|
|||
|
oldNullable: true);
|
|||
|
|
|||
|
migrationBuilder.AlterColumn<string>(
|
|||
|
name: "Discriminator",
|
|||
|
table: "Users",
|
|||
|
type: "varchar(255) CHARACTER SET utf8mb4",
|
|||
|
nullable: false,
|
|||
|
oldClrType: typeof(string));
|
|||
|
|
|||
|
migrationBuilder.CreateIndex(
|
|||
|
name: "IX_Users_Discriminator_Name",
|
|||
|
table: "Users",
|
|||
|
columns: new[] { "Discriminator", "Name" },
|
|||
|
unique: true);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|