| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using Microsoft.EntityFrameworkCore.Migrations;
- #nullable disable
- namespace Infrastructure.Migrations.AppDb
- {
- /// <inheritdoc />
- public partial class AddProductDiscount : Migration
- {
- /// <inheritdoc />
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn<byte>(
- name: "DiscountType",
- table: "Product",
- type: "tinyint",
- nullable: false,
- defaultValue: (byte)0,
- comment: "할인 모드 (0=None, 1=Percent, 2=Amount)");
- migrationBuilder.AddColumn<int>(
- name: "DiscountValue",
- table: "Product",
- type: "int",
- nullable: false,
- defaultValue: 0,
- comment: "할인 값 (Percent: 0..99, Amount: 0..Price)");
- migrationBuilder.AlterColumn<int>(
- name: "Price",
- table: "Product",
- type: "int",
- nullable: false,
- comment: "정가 (P)",
- oldClrType: typeof(int),
- oldType: "int",
- oldComment: "판매가 (KRW)");
- }
- /// <inheritdoc />
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(name: "DiscountValue", table: "Product");
- migrationBuilder.DropColumn(name: "DiscountType", table: "Product");
- migrationBuilder.AlterColumn<int>(
- name: "Price",
- table: "Product",
- type: "int",
- nullable: false,
- comment: "판매가 (KRW)",
- oldClrType: typeof(int),
- oldType: "int",
- oldComment: "정가 (P)");
- }
- }
- }
|