Files
TakeoutSaaS.TenantApi/src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/20260222010354_AddProductDetailRichFields.cs
MSuMshk d66879f5cf
All checks were successful
Build and Deploy TenantApi / build-and-deploy (push) Successful in 47s
feat(product): complete combo and detail editing data model
2026-02-22 09:35:57 +08:00

67 lines
2.0 KiB
C#

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");
}
}
}