20260605030008_AddNiceAuthSession.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace Infrastructure.Persistence.Migrations
  5. {
  6. /// <inheritdoc />
  7. public partial class AddNiceAuthSession : Migration
  8. {
  9. /// <inheritdoc />
  10. protected override void Up(MigrationBuilder migrationBuilder)
  11. {
  12. migrationBuilder.CreateTable(
  13. name: "NiceAuthSession",
  14. columns: table => new
  15. {
  16. ID = table.Column<int>(type: "int", nullable: false)
  17. .Annotation("SqlServer:Identity", "1, 1"),
  18. DeveloperID = table.Column<int>(type: "int", nullable: false),
  19. SessionToken = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
  20. RequestNo = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
  21. TransactionID = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
  22. WebTransactionID = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
  23. Ticket = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
  24. Iterators = table.Column<int>(type: "int", nullable: false),
  25. Status = table.Column<int>(type: "int", nullable: false),
  26. FailReason = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
  27. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
  28. ExpiresAt = table.Column<DateTime>(type: "datetime2", nullable: false),
  29. CompletedAt = table.Column<DateTime>(type: "datetime2", nullable: true)
  30. },
  31. constraints: table =>
  32. {
  33. table.PrimaryKey("PK_NiceAuthSession", x => x.ID);
  34. table.ForeignKey(
  35. name: "FK_NiceAuthSession_Developer_DeveloperID",
  36. column: x => x.DeveloperID,
  37. principalTable: "Developer",
  38. principalColumn: "ID",
  39. onDelete: ReferentialAction.Cascade);
  40. },
  41. comment: "NICE 통합인증 1회 진행 세션");
  42. migrationBuilder.CreateIndex(
  43. name: "IX_NiceAuthSession_DeveloperID_CreatedAt",
  44. table: "NiceAuthSession",
  45. columns: new[] { "DeveloperID", "CreatedAt" });
  46. migrationBuilder.CreateIndex(
  47. name: "IX_NiceAuthSession_SessionToken",
  48. table: "NiceAuthSession",
  49. column: "SessionToken",
  50. unique: true);
  51. migrationBuilder.CreateIndex(
  52. name: "IX_NiceAuthSession_Status",
  53. table: "NiceAuthSession",
  54. column: "Status");
  55. }
  56. /// <inheritdoc />
  57. protected override void Down(MigrationBuilder migrationBuilder)
  58. {
  59. migrationBuilder.DropTable(
  60. name: "NiceAuthSession");
  61. }
  62. }
  63. }