20260411192023_AddCrewInviteCode.cs 1002 B

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