20260411192023_AddCrewInviteCode.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Infrastructure.Migrations.AppDb
  4. {
  5. /// <inheritdoc />
  6. public partial class AddCrewInviteCode : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.AddColumn<string>(
  12. name: "InviteCode",
  13. table: "Crew",
  14. type: "nvarchar(8)",
  15. maxLength: 8,
  16. nullable: true);
  17. migrationBuilder.CreateIndex(
  18. name: "IX_Crew_InviteCode",
  19. table: "Crew",
  20. column: "InviteCode",
  21. unique: true,
  22. filter: "[InviteCode] IS NOT NULL");
  23. }
  24. /// <inheritdoc />
  25. protected override void Down(MigrationBuilder migrationBuilder)
  26. {
  27. migrationBuilder.DropIndex(
  28. name: "IX_Crew_InviteCode",
  29. table: "Crew");
  30. migrationBuilder.DropColumn(
  31. name: "InviteCode",
  32. table: "Crew");
  33. }
  34. }
  35. }