20260310140923_AddMemberExpLog.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Migrations;
  3. #nullable disable
  4. namespace Infrastructure.Migrations.AppDb
  5. {
  6. /// <inheritdoc />
  7. public partial class AddMemberExpLog : Migration
  8. {
  9. /// <inheritdoc />
  10. protected override void Up(MigrationBuilder migrationBuilder)
  11. {
  12. migrationBuilder.CreateTable(
  13. name: "MemberExpLog",
  14. columns: table => new
  15. {
  16. ID = table.Column<int>(type: "int", nullable: false, comment: "PK")
  17. .Annotation("SqlServer:Identity", "1, 1"),
  18. MemberID = table.Column<int>(type: "int", nullable: false, comment: "회원 ID"),
  19. Reason = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false, comment: "사유"),
  20. Amount = table.Column<int>(type: "int", nullable: false, comment: "변동량"),
  21. Balance = table.Column<long>(type: "bigint", nullable: false, comment: "잔액"),
  22. CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false, comment: "기록 일시")
  23. },
  24. constraints: table =>
  25. {
  26. table.PrimaryKey("PK_MemberExpLog", x => x.ID);
  27. table.ForeignKey(
  28. name: "FK_MemberExpLog_Member_MemberID",
  29. column: x => x.MemberID,
  30. principalTable: "Member",
  31. principalColumn: "ID",
  32. onDelete: ReferentialAction.Cascade);
  33. },
  34. comment: "경험치 변동 내역");
  35. migrationBuilder.CreateIndex(
  36. name: "IX_MemberExpLog_MemberID",
  37. table: "MemberExpLog",
  38. column: "MemberID");
  39. }
  40. /// <inheritdoc />
  41. protected override void Down(MigrationBuilder migrationBuilder)
  42. {
  43. migrationBuilder.DropTable(
  44. name: "MemberExpLog");
  45. }
  46. }
  47. }