20260604044125_AddDeveloperEntity.cs 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace Infrastructure.Migrations.AppDb
  5. {
  6. /// <inheritdoc />
  7. public partial class AddDeveloperEntity : Migration
  8. {
  9. /// <inheritdoc />
  10. protected override void Up(MigrationBuilder migrationBuilder)
  11. {
  12. migrationBuilder.CreateTable(
  13. name: "Developer",
  14. columns: table => new
  15. {
  16. ID = table.Column<int>(type: "int", nullable: false)
  17. .Annotation("SqlServer:Identity", "1, 1"),
  18. MemberID = table.Column<int>(type: "int", nullable: false),
  19. CompanyName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
  20. BusinessNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: false),
  21. CeoName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
  22. ContactName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
  23. ContactPhone = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
  24. KycStatus = table.Column<int>(type: "int", nullable: false),
  25. KycCi = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
  26. KycDi = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
  27. KycVerifiedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
  28. ApprovalStatus = table.Column<int>(type: "int", nullable: false),
  29. ApprovalReason = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
  30. ApprovedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
  31. ApprovedByAdminID = table.Column<string>(type: "nvarchar(450)", maxLength: 450, nullable: true),
  32. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false),
  33. UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true)
  34. },
  35. constraints: table =>
  36. {
  37. table.PrimaryKey("PK_Developer", x => x.ID);
  38. table.ForeignKey(
  39. name: "FK_Developer_Member_MemberID",
  40. column: x => x.MemberID,
  41. principalTable: "Member",
  42. principalColumn: "ID",
  43. onDelete: ReferentialAction.Cascade);
  44. },
  45. comment: "개발자 포털 가입 법인 정보 (Member 1:1)");
  46. migrationBuilder.CreateIndex(
  47. name: "IX_Developer_ApprovalStatus",
  48. table: "Developer",
  49. column: "ApprovalStatus");
  50. migrationBuilder.CreateIndex(
  51. name: "IX_Developer_BusinessNumber",
  52. table: "Developer",
  53. column: "BusinessNumber");
  54. migrationBuilder.CreateIndex(
  55. name: "IX_Developer_MemberID",
  56. table: "Developer",
  57. column: "MemberID",
  58. unique: true);
  59. }
  60. /// <inheritdoc />
  61. protected override void Down(MigrationBuilder migrationBuilder)
  62. {
  63. migrationBuilder.DropTable(
  64. name: "Developer");
  65. }
  66. }
  67. }