| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System;
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Infrastructure.Migrations.AppDb
- {
- /// <inheritdoc />
- public partial class AddProductLimitConfig : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "ProductLimitConfig",
- columns: table => new
- {
- ProductID = table.Column<int>(type: "int", nullable: false),
- UseQuantityLimit = table.Column<bool>(type: "bit", nullable: false, comment: "수량 제한 사용 여부"),
- MaxQuantity = table.Column<int>(type: "int", nullable: false, comment: "회원당 누적 최대 구매 수량 (0=무제한)"),
- UsePeriodLimit = table.Column<bool>(type: "bit", nullable: false, comment: "기간 제한 사용 여부"),
- PeriodType = table.Column<int>(type: "int", nullable: false, comment: "기간 유형 (0=None, 1=Day, 2=Week, 3=Month, 4=Custom)"),
- PeriodHours = table.Column<int>(type: "int", nullable: false, comment: "Custom 시 누적 윈도우 (시간 단위)"),
- UpdatedAt = table.Column<DateTime>(type: "datetime2", nullable: true),
- CreatedAt = table.Column<DateTime>(type: "datetime2", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ProductLimitConfig", x => x.ProductID);
- table.ForeignKey(
- name: "FK_ProductLimitConfig_Product_ProductID",
- column: x => x.ProductID,
- principalTable: "Product",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- },
- comment: "상품 판매 정책 (1:1 with Product)");
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "ProductLimitConfig");
- }
- }
- }
|