forked from xiongyuxing/tiku-backend.net
feat: add operations catalog readonly endpoints
This commit is contained in:
@@ -22,8 +22,9 @@ internal sealed class ProductConfiguration : IEntityTypeConfiguration<Product>
|
||||
builder.Property(entity => entity.Cover).HasMaxLength(2048);
|
||||
builder.Property(entity => entity.PreviewIframe).HasMaxLength(2048);
|
||||
builder.Property(entity => entity.DetailImages).IsJson("[]");
|
||||
builder.Property(entity => entity.IsActive).HasDefaultValue(true);
|
||||
builder.HasIndex(entity => new { entity.TenantId, entity.LegacyId }).IsUnique();
|
||||
builder.HasIndex(entity => new { entity.TenantId, entity.RegionId, entity.Type, entity.SortOrder });
|
||||
builder.HasIndex(entity => new { entity.TenantId, entity.RegionId, entity.Type, entity.IsActive, entity.SortOrder });
|
||||
builder.HasOne<Region>().WithMany()
|
||||
.HasForeignKey(entity => new { entity.TenantId, entity.RegionId })
|
||||
.HasPrincipalKey(entity => new { entity.TenantId, entity.Id })
|
||||
|
||||
15308
Tiku.Infrastructure/Persistence/Migrations/20260726071027_AddProductActiveAndOperationsCatalog.Designer.cs
generated
Normal file
15308
Tiku.Infrastructure/Persistence/Migrations/20260726071027_AddProductActiveAndOperationsCatalog.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,47 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Tiku.Infrastructure.Persistence.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddProductActiveAndOperationsCatalog : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "ix_products_tenant_id_region_id_type_sort_order",
|
||||
table: "products");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "is_active",
|
||||
table: "products",
|
||||
type: "boolean",
|
||||
nullable: false,
|
||||
defaultValue: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_products_tenant_id_region_id_type_is_active_sort_order",
|
||||
table: "products",
|
||||
columns: new[] { "tenant_id", "region_id", "type", "is_active", "sort_order" });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropIndex(
|
||||
name: "ix_products_tenant_id_region_id_type_is_active_sort_order",
|
||||
table: "products");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "is_active",
|
||||
table: "products");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_products_tenant_id_region_id_type_sort_order",
|
||||
table: "products",
|
||||
columns: new[] { "tenant_id", "region_id", "type", "sort_order" });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2441,6 +2441,12 @@ namespace Tiku.Infrastructure.Persistence.Migrations
|
||||
.HasColumnName("detail_images")
|
||||
.HasDefaultValueSql("'[]'::jsonb");
|
||||
|
||||
b.Property<bool>("IsActive")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("boolean")
|
||||
.HasDefaultValue(true)
|
||||
.HasColumnName("is_active");
|
||||
|
||||
b.Property<string>("LegacyId")
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("character varying(64)")
|
||||
@@ -2507,8 +2513,8 @@ namespace Tiku.Infrastructure.Persistence.Migrations
|
||||
.IsUnique()
|
||||
.HasDatabaseName("ix_products_tenant_id_legacy_id");
|
||||
|
||||
b.HasIndex("TenantId", "RegionId", "Type", "SortOrder")
|
||||
.HasDatabaseName("ix_products_tenant_id_region_id_type_sort_order");
|
||||
b.HasIndex("TenantId", "RegionId", "Type", "IsActive", "SortOrder")
|
||||
.HasDatabaseName("ix_products_tenant_id_region_id_type_is_active_sort_order");
|
||||
|
||||
b.ToTable("products", (string)null);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user