using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Foxnouns.Backend.Database.Migrations { /// [DbContext(typeof(DatabaseContext))] [Migration("20241128202508_AddAuthMethodUniqueIndex")] public partial class AddAuthMethodUniqueIndex : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateIndex( name: "ix_auth_methods_auth_type_remote_id", table: "auth_methods", columns: new[] { "auth_type", "remote_id" }, unique: true, filter: "fediverse_application_id IS NULL" ); migrationBuilder.CreateIndex( name: "ix_auth_methods_auth_type_remote_id_fediverse_application_id", table: "auth_methods", columns: new[] { "auth_type", "remote_id", "fediverse_application_id" }, unique: true, filter: "fediverse_application_id IS NOT NULL" ); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropIndex( name: "ix_auth_methods_auth_type_remote_id", table: "auth_methods" ); migrationBuilder.DropIndex( name: "ix_auth_methods_auth_type_remote_id_fediverse_application_id", table: "auth_methods" ); } } }