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