using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace ErsatzTV.Infrastructure.MySql.Migrations { /// public partial class Add_SmartCollectionNameUnique : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( name: "Name", table: "SmartCollection", type: "varchar(255)", nullable: true, oldClrType: typeof(string), oldType: "longtext", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_SmartCollection_Name", table: "SmartCollection", column: "Name", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropIndex( name: "IX_SmartCollection_Name", table: "SmartCollection"); migrationBuilder.AlterColumn( name: "Name", table: "SmartCollection", type: "longtext", nullable: true, oldClrType: typeof(string), oldType: "varchar(255)", oldNullable: true) .Annotation("MySql:CharSet", "utf8mb4") .OldAnnotation("MySql:CharSet", "utf8mb4"); } } }