From 53665eae050a4779ceb75c034353a88ebe62d61d Mon Sep 17 00:00:00 2001 From: Eduardo Lopes <155753879+eduardolopesx03@users.noreply.github.com> Date: Fri, 23 Jan 2026 12:20:11 -0300 Subject: [PATCH] Add safe index rename migration --- .../20260210120001_RenameUserNameIndexSafe.cs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Migrations/20260210120001_RenameUserNameIndexSafe.cs diff --git a/Migrations/20260210120001_RenameUserNameIndexSafe.cs b/Migrations/20260210120001_RenameUserNameIndexSafe.cs new file mode 100644 index 0000000..f3eeb3a --- /dev/null +++ b/Migrations/20260210120001_RenameUserNameIndexSafe.cs @@ -0,0 +1,22 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace line_gestao_api.Migrations +{ + /// + public partial class RenameUserNameIndexSafe : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.Sql("ALTER INDEX IF EXISTS \"IX_AspNetUsers_NormalizedUserName\" RENAME TO \"UserNameIndex\""); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.Sql("ALTER INDEX IF EXISTS \"UserNameIndex\" RENAME TO \"IX_AspNetUsers_NormalizedUserName\""); + } + } +}