20260523175535_AddProductMinMaxPurchase.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Microsoft.EntityFrameworkCore.Migrations;
  2. #nullable disable
  3. namespace Infrastructure.Migrations.AppDb
  4. {
  5. /// <inheritdoc />
  6. public partial class AddProductMinMaxPurchase : Migration
  7. {
  8. /// <inheritdoc />
  9. protected override void Up(MigrationBuilder migrationBuilder)
  10. {
  11. migrationBuilder.AddColumn<int>(
  12. name: "MaxPurchase",
  13. table: "Product",
  14. type: "int",
  15. nullable: false,
  16. defaultValue: 999,
  17. comment: "1회 주문 최대 구매 수량 (하드 상한 999)");
  18. migrationBuilder.AddColumn<int>(
  19. name: "MinPurchase",
  20. table: "Product",
  21. type: "int",
  22. nullable: false,
  23. defaultValue: 1,
  24. comment: "1회 주문 최소 구매 수량");
  25. }
  26. /// <inheritdoc />
  27. protected override void Down(MigrationBuilder migrationBuilder)
  28. {
  29. migrationBuilder.DropColumn(
  30. name: "MaxPurchase",
  31. table: "Product");
  32. migrationBuilder.DropColumn(
  33. name: "MinPurchase",
  34. table: "Product");
  35. }
  36. }
  37. }