feat(product): complete combo and detail editing data model
All checks were successful
Build and Deploy TenantApi / build-and-deploy (push) Successful in 47s
All checks were successful
Build and Deploy TenantApi / build-and-deploy (push) Successful in 47s
This commit is contained in:
8559
src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/20260222000604_AddProductComboGroups.Designer.cs
generated
Normal file
8559
src/Infrastructure/TakeoutSaaS.Infrastructure/Migrations/20260222000604_AddProductComboGroups.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TakeoutSaaS.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddProductComboGroups : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "product_combo_group_items",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false, comment: "实体唯一标识。")
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ComboGroupId = table.Column<long>(type: "bigint", nullable: false, comment: "所属套餐分组 ID。"),
|
||||
ProductId = table.Column<long>(type: "bigint", nullable: false, comment: "商品 ID。"),
|
||||
Quantity = table.Column<int>(type: "integer", nullable: false, comment: "数量。"),
|
||||
SortOrder = table.Column<int>(type: "integer", nullable: false, comment: "排序值。"),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, comment: "创建时间(UTC)。"),
|
||||
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true, comment: "最近一次更新时间(UTC),从未更新时为 null。"),
|
||||
DeletedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true, comment: "软删除时间(UTC),未删除时为 null。"),
|
||||
CreatedBy = table.Column<long>(type: "bigint", nullable: true, comment: "创建人用户标识,匿名或系统操作时为 null。"),
|
||||
UpdatedBy = table.Column<long>(type: "bigint", nullable: true, comment: "最后更新人用户标识,匿名或系统操作时为 null。"),
|
||||
DeletedBy = table.Column<long>(type: "bigint", nullable: true, comment: "删除人用户标识(软删除),未删除时为 null。"),
|
||||
TenantId = table.Column<long>(type: "bigint", nullable: false, comment: "所属租户 ID。")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_product_combo_group_items", x => x.Id);
|
||||
},
|
||||
comment: "套餐分组内商品。");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "product_combo_groups",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false, comment: "实体唯一标识。")
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
ProductId = table.Column<long>(type: "bigint", nullable: false, comment: "套餐商品 ID。"),
|
||||
Name = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false, comment: "分组名称。"),
|
||||
MinSelect = table.Column<int>(type: "integer", nullable: false, comment: "最小选择数。"),
|
||||
MaxSelect = table.Column<int>(type: "integer", nullable: false, comment: "最大选择数。"),
|
||||
SortOrder = table.Column<int>(type: "integer", nullable: false, comment: "排序值。"),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false, comment: "创建时间(UTC)。"),
|
||||
UpdatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true, comment: "最近一次更新时间(UTC),从未更新时为 null。"),
|
||||
DeletedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true, comment: "软删除时间(UTC),未删除时为 null。"),
|
||||
CreatedBy = table.Column<long>(type: "bigint", nullable: true, comment: "创建人用户标识,匿名或系统操作时为 null。"),
|
||||
UpdatedBy = table.Column<long>(type: "bigint", nullable: true, comment: "最后更新人用户标识,匿名或系统操作时为 null。"),
|
||||
DeletedBy = table.Column<long>(type: "bigint", nullable: true, comment: "删除人用户标识(软删除),未删除时为 null。"),
|
||||
TenantId = table.Column<long>(type: "bigint", nullable: false, comment: "所属租户 ID。")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_product_combo_groups", x => x.Id);
|
||||
},
|
||||
comment: "套餐分组。");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_product_combo_group_items_TenantId_ComboGroupId_ProductId",
|
||||
table: "product_combo_group_items",
|
||||
columns: new[] { "TenantId", "ComboGroupId", "ProductId" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_product_combo_group_items_TenantId_ComboGroupId_SortOrder",
|
||||
table: "product_combo_group_items",
|
||||
columns: new[] { "TenantId", "ComboGroupId", "SortOrder" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_product_combo_groups_TenantId_ProductId_Name",
|
||||
table: "product_combo_groups",
|
||||
columns: new[] { "TenantId", "ProductId", "Name" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_product_combo_groups_TenantId_ProductId_SortOrder",
|
||||
table: "product_combo_groups",
|
||||
columns: new[] { "TenantId", "ProductId", "SortOrder" });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "product_combo_group_items");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "product_combo_groups");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,66 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4007,6 +4007,11 @@ namespace TakeoutSaaS.Infrastructure.Migrations
|
||||
.HasColumnType("numeric(18,2)")
|
||||
.HasComment("原价。");
|
||||
|
||||
b.Property<decimal?>("PackingFee")
|
||||
.HasPrecision(18, 2)
|
||||
.HasColumnType("numeric(18,2)")
|
||||
.HasComment("打包费(元/份)。");
|
||||
|
||||
b.Property<decimal>("Price")
|
||||
.HasPrecision(18, 2)
|
||||
.HasColumnType("numeric(18,2)")
|
||||
@@ -4035,6 +4040,12 @@ namespace TakeoutSaaS.Infrastructure.Migrations
|
||||
.HasColumnType("character varying(256)")
|
||||
.HasComment("沽清原因。");
|
||||
|
||||
b.Property<int>("SortWeight")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer")
|
||||
.HasDefaultValue(0)
|
||||
.HasComment("排序权重,越大越靠前。");
|
||||
|
||||
b.Property<string>("SpuCode")
|
||||
.IsRequired()
|
||||
.HasMaxLength(32)
|
||||
@@ -4091,6 +4102,10 @@ namespace TakeoutSaaS.Infrastructure.Migrations
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
|
||||
|
||||
b.Property<int?>("WarningStock")
|
||||
.HasColumnType("integer")
|
||||
.HasComment("库存预警值。");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TenantId", "SpuCode")
|
||||
@@ -4475,6 +4490,143 @@ namespace TakeoutSaaS.Infrastructure.Migrations
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductComboGroup", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("实体唯一标识。");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasComment("创建时间(UTC)。");
|
||||
|
||||
b.Property<long?>("CreatedBy")
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasComment("软删除时间(UTC),未删除时为 null。");
|
||||
|
||||
b.Property<long?>("DeletedBy")
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("删除人用户标识(软删除),未删除时为 null。");
|
||||
|
||||
b.Property<int>("MaxSelect")
|
||||
.HasColumnType("integer")
|
||||
.HasComment("最大选择数。");
|
||||
|
||||
b.Property<int>("MinSelect")
|
||||
.HasColumnType("integer")
|
||||
.HasComment("最小选择数。");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("character varying(64)")
|
||||
.HasComment("分组名称。");
|
||||
|
||||
b.Property<long>("ProductId")
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("套餐商品 ID。");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.HasColumnType("integer")
|
||||
.HasComment("排序值。");
|
||||
|
||||
b.Property<long>("TenantId")
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("所属租户 ID。");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
|
||||
|
||||
b.Property<long?>("UpdatedBy")
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TenantId", "ProductId", "Name");
|
||||
|
||||
b.HasIndex("TenantId", "ProductId", "SortOrder");
|
||||
|
||||
b.ToTable("product_combo_groups", null, t =>
|
||||
{
|
||||
t.HasComment("套餐分组。");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductComboGroupItem", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("实体唯一标识。");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<long>("Id"));
|
||||
|
||||
b.Property<long>("ComboGroupId")
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("所属套餐分组 ID。");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasComment("创建时间(UTC)。");
|
||||
|
||||
b.Property<long?>("CreatedBy")
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("创建人用户标识,匿名或系统操作时为 null。");
|
||||
|
||||
b.Property<DateTime?>("DeletedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasComment("软删除时间(UTC),未删除时为 null。");
|
||||
|
||||
b.Property<long?>("DeletedBy")
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("删除人用户标识(软删除),未删除时为 null。");
|
||||
|
||||
b.Property<long>("ProductId")
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("商品 ID。");
|
||||
|
||||
b.Property<int>("Quantity")
|
||||
.HasColumnType("integer")
|
||||
.HasComment("数量。");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.HasColumnType("integer")
|
||||
.HasComment("排序值。");
|
||||
|
||||
b.Property<long>("TenantId")
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("所属租户 ID。");
|
||||
|
||||
b.Property<DateTime?>("UpdatedAt")
|
||||
.HasColumnType("timestamp with time zone")
|
||||
.HasComment("最近一次更新时间(UTC),从未更新时为 null。");
|
||||
|
||||
b.Property<long?>("UpdatedBy")
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("最后更新人用户标识,匿名或系统操作时为 null。");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TenantId", "ComboGroupId", "ProductId")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("TenantId", "ComboGroupId", "SortOrder");
|
||||
|
||||
b.ToTable("product_combo_group_items", null, t =>
|
||||
{
|
||||
t.HasComment("套餐分组内商品。");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TakeoutSaaS.Domain.Products.Entities.ProductLabel", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
@@ -4933,6 +5085,12 @@ namespace TakeoutSaaS.Infrastructure.Migrations
|
||||
.HasColumnType("bigint")
|
||||
.HasComment("删除人用户标识(软删除),未删除时为 null。");
|
||||
|
||||
b.Property<bool>("IsEnabled")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("boolean")
|
||||
.HasDefaultValue(true)
|
||||
.HasComment("是否启用。");
|
||||
|
||||
b.Property<decimal?>("OriginalPrice")
|
||||
.HasPrecision(18, 2)
|
||||
.HasColumnType("numeric(18,2)")
|
||||
|
||||
Reference in New Issue
Block a user