20260310140923_AddMemberExpLog.cs 1.9 KB

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