using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace TakeoutSaaS.Infrastructure.Migrations
{
    /// <inheritdoc />
    public partial class AddProductDetailRichFields : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<decimal>(
                name: "PackingFee",
                table: "products",
                type: "numeric(18,2)",
                precision: 18,
                scale: 2,
                nullable: true,
                comment: "打包费（元/份）。");

            migrationBuilder.AddColumn<int>(
                name: "SortWeight",
                table: "products",
                type: "integer",
                nullable: false,
                defaultValue: 0,
                comment: "排序权重，越大越靠前。");

            migrationBuilder.AddColumn<int>(
                name: "WarningStock",
                table: "products",
                type: "integer",
                nullable: true,
                comment: "库存预警值。");

            migrationBuilder.AddColumn<bool>(
                name: "IsEnabled",
                table: "product_skus",
                type: "boolean",
                nullable: false,
                defaultValue: true,
                comment: "是否启用。");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "PackingFee",
                table: "products");

            migrationBuilder.DropColumn(
                name: "SortWeight",
                table: "products");

            migrationBuilder.DropColumn(
                name: "WarningStock",
                table: "products");

            migrationBuilder.DropColumn(
                name: "IsEnabled",
                table: "product_skus");
        }
    }
}
