20260524075855_AddChannelDonationCode.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Infrastructure.Migrations.AppDb
  4. {
  5. /// <inheritdoc />
  6. public partial class AddChannelDonationCode : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.AddColumn<string>(
  12. name: "DonationCode",
  13. table: "Channel",
  14. type: "nvarchar(7)",
  15. maxLength: 7,
  16. nullable: true,
  17. comment: "후원 코드(4~7자 영문+숫자, 대문자). 1회성 발급, 변경 불가");
  18. migrationBuilder.CreateIndex(
  19. name: "IX_Channel_DonationCode",
  20. table: "Channel",
  21. column: "DonationCode",
  22. unique: true,
  23. filter: "[DonationCode] IS NOT NULL");
  24. }
  25. /// <inheritdoc />
  26. protected override void Down(MigrationBuilder migrationBuilder)
  27. {
  28. migrationBuilder.DropIndex(
  29. name: "IX_Channel_DonationCode",
  30. table: "Channel");
  31. migrationBuilder.DropColumn(
  32. name: "DonationCode",
  33. table: "Channel");
  34. }
  35. }
  36. }