1027 lines
38 KiB
C#
1027 lines
38 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Prefab.Web.Data;
|
|
|
|
#nullable disable
|
|
|
|
namespace Prefab.Web.Data.Migrations
|
|
{
|
|
[DbContext(typeof(AppDb))]
|
|
[Migration("20251024202413_Initial")]
|
|
partial class Initial
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "10.0.0-rc.2.25502.107")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.AttributeDefinition", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("CreatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<int>("DataType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<Guid?>("DeletedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("DeletedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid?>("InactivatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("InactivatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid>("LastModifiedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<byte[]>("RowVersion")
|
|
.IsConcurrencyToken()
|
|
.IsRequired()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("rowversion");
|
|
|
|
b.Property<string>("Unit")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("AttributeDefinitions", "catalog");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.Category", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("CreatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid?>("DeletedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("DeletedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<string>("Description")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("nvarchar(500)");
|
|
|
|
b.Property<int>("DisplayOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("HeroImageUrl")
|
|
.HasMaxLength(512)
|
|
.HasColumnType("nvarchar(512)");
|
|
|
|
b.Property<string>("Icon")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("nvarchar(128)");
|
|
|
|
b.Property<Guid?>("InactivatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("InactivatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<bool>("IsFeatured")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<Guid>("LastModifiedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("nvarchar(100)");
|
|
|
|
b.Property<Guid?>("ParentId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<byte[]>("RowVersion")
|
|
.IsConcurrencyToken()
|
|
.IsRequired()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("rowversion");
|
|
|
|
b.Property<string>("Slug")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("nvarchar(128)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Slug")
|
|
.IsUnique()
|
|
.HasFilter("[Slug] IS NOT NULL");
|
|
|
|
b.ToTable("Categories", "catalog");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.OptionDefinition", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("Code")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("nvarchar(64)");
|
|
|
|
b.Property<Guid>("CreatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<int>("DataType")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<Guid?>("DeletedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("DeletedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid?>("InactivatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("InactivatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<bool>("IsVariantAxis")
|
|
.HasColumnType("bit");
|
|
|
|
b.Property<Guid>("LastModifiedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<decimal?>("Max")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<decimal?>("Min")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<int?>("PercentScope")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<decimal?>("PricePerUnit")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<Guid>("ProductId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<byte[]>("RowVersion")
|
|
.IsConcurrencyToken()
|
|
.IsRequired()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("rowversion");
|
|
|
|
b.Property<decimal?>("Step")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<string>("Unit")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ProductId", "Code")
|
|
.IsUnique();
|
|
|
|
b.ToTable("OptionDefinitions", "catalog");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.OptionRuleCondition", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("CreatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid?>("DeletedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("DeletedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid?>("InactivatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("InactivatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid>("LastModifiedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid>("LeftOptionDefinitionId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<byte>("Operator")
|
|
.HasColumnType("tinyint");
|
|
|
|
b.Property<string>("RightList")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<decimal?>("RightMax")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<decimal?>("RightMin")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<decimal?>("RightNumber")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<Guid?>("RightOptionValueId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<byte[]>("RowVersion")
|
|
.IsConcurrencyToken()
|
|
.IsRequired()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("rowversion");
|
|
|
|
b.Property<Guid>("RuleSetId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("LeftOptionDefinitionId");
|
|
|
|
b.HasIndex("RightOptionValueId");
|
|
|
|
b.HasIndex("RuleSetId");
|
|
|
|
b.ToTable("OptionRuleConditions", "catalog");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.OptionRuleSet", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("CreatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid?>("DeletedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("DeletedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<byte>("Effect")
|
|
.HasColumnType("tinyint");
|
|
|
|
b.Property<Guid?>("InactivatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("InactivatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid>("LastModifiedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<byte>("Mode")
|
|
.HasColumnType("tinyint");
|
|
|
|
b.Property<Guid>("ProductId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<byte[]>("RowVersion")
|
|
.IsConcurrencyToken()
|
|
.IsRequired()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("rowversion");
|
|
|
|
b.Property<Guid>("TargetId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<byte>("TargetKind")
|
|
.HasColumnType("tinyint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ProductId", "TargetKind", "TargetId");
|
|
|
|
b.ToTable("OptionRuleSets", "catalog");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.OptionTier", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("CreatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid?>("DeletedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("DeletedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<decimal?>("FlatDelta")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<decimal>("FromInclusive")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<Guid?>("InactivatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("InactivatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid>("LastModifiedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid>("OptionDefinitionId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<byte[]>("RowVersion")
|
|
.IsConcurrencyToken()
|
|
.IsRequired()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("rowversion");
|
|
|
|
b.Property<decimal?>("ToInclusive")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<decimal>("UnitRate")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OptionDefinitionId", "FromInclusive", "ToInclusive");
|
|
|
|
b.ToTable("OptionTiers", "catalog");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.OptionValue", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("Code")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("nvarchar(64)");
|
|
|
|
b.Property<Guid>("CreatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid?>("DeletedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("DeletedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid?>("InactivatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("InactivatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<string>("Label")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<Guid>("LastModifiedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid>("OptionDefinitionId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<decimal?>("PriceDelta")
|
|
.HasPrecision(9, 4)
|
|
.HasColumnType("decimal(9,4)");
|
|
|
|
b.Property<int>("PriceDeltaKind")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<byte[]>("RowVersion")
|
|
.IsConcurrencyToken()
|
|
.IsRequired()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("rowversion");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OptionDefinitionId", "Code")
|
|
.IsUnique();
|
|
|
|
b.ToTable("OptionValues", "catalog");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.Product", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("CreatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid?>("DeletedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("DeletedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<string>("Description")
|
|
.HasMaxLength(2048)
|
|
.HasColumnType("nvarchar(2048)");
|
|
|
|
b.Property<Guid?>("InactivatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("InactivatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<int>("Kind")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<Guid>("LastModifiedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.Property<Guid?>("ParentProductId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<decimal?>("Price")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("decimal(18,2)");
|
|
|
|
b.Property<byte[]>("RowVersion")
|
|
.IsConcurrencyToken()
|
|
.IsRequired()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("rowversion");
|
|
|
|
b.Property<string>("Sku")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("nvarchar(64)");
|
|
|
|
b.Property<string>("Slug")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ParentProductId");
|
|
|
|
b.HasIndex("Sku")
|
|
.IsUnique()
|
|
.HasFilter("[Sku] IS NOT NULL");
|
|
|
|
b.HasIndex("Slug")
|
|
.IsUnique()
|
|
.HasFilter("[Slug] IS NOT NULL");
|
|
|
|
b.ToTable("Products", "catalog");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.ProductAttributeValue", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("AttributeDefinitionId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("CreatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid?>("DeletedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("DeletedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<string>("EnumCode")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("nvarchar(64)");
|
|
|
|
b.Property<Guid?>("InactivatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("InactivatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid>("LastModifiedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<decimal?>("NumericValue")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("decimal(18,4)");
|
|
|
|
b.Property<Guid>("ProductId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<byte[]>("RowVersion")
|
|
.IsConcurrencyToken()
|
|
.IsRequired()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("rowversion");
|
|
|
|
b.Property<string>("UnitCode")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("nvarchar(32)");
|
|
|
|
b.Property<string>("Value")
|
|
.HasMaxLength(1024)
|
|
.HasColumnType("nvarchar(1024)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AttributeDefinitionId");
|
|
|
|
b.HasIndex("ProductId", "AttributeDefinitionId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("ProductAttributeValues", "catalog");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.ProductCategory", b =>
|
|
{
|
|
b.Property<Guid>("ProductId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("CategoryId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<bool>("IsPrimary")
|
|
.HasColumnType("bit");
|
|
|
|
b.HasKey("ProductId", "CategoryId");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.ToTable("ProductCategories", "catalog");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.VariantAxisValue", b =>
|
|
{
|
|
b.Property<Guid>("ProductVariantId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("OptionDefinitionId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("OptionValueId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.HasKey("ProductVariantId", "OptionDefinitionId");
|
|
|
|
b.HasIndex("OptionDefinitionId");
|
|
|
|
b.HasIndex("OptionValueId");
|
|
|
|
b.ToTable("VariantAxisValues", "catalog");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Data.Entities.AuditLog", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<Guid>("CorrelationId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<Guid>("CreatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<string>("Entity")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("nvarchar(200)");
|
|
|
|
b.Property<string>("State")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("AuditLogs");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Data.Entities.AuditLogItem", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("AuditLogId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("NewValue")
|
|
.HasMaxLength(1000)
|
|
.HasColumnType("nvarchar(1000)");
|
|
|
|
b.Property<string>("OldValue")
|
|
.HasMaxLength(1000)
|
|
.HasColumnType("nvarchar(1000)");
|
|
|
|
b.Property<string>("Property")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("nvarchar(100)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AuditLogId");
|
|
|
|
b.ToTable("AuditLogItems");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Data.Entities.GenericAttribute", b =>
|
|
{
|
|
b.Property<Guid>("EntityId")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<string>("KeyGroup")
|
|
.HasMaxLength(400)
|
|
.HasColumnType("nvarchar(400)");
|
|
|
|
b.Property<string>("Key")
|
|
.HasMaxLength(400)
|
|
.HasColumnType("nvarchar(400)");
|
|
|
|
b.Property<Guid>("CreatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("CreatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid?>("DeletedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("DeletedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid?>("InactivatedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset?>("InactivatedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<Guid>("LastModifiedBy")
|
|
.HasColumnType("uniqueidentifier");
|
|
|
|
b.Property<DateTimeOffset>("LastModifiedOn")
|
|
.HasColumnType("datetimeoffset");
|
|
|
|
b.Property<byte[]>("RowVersion")
|
|
.IsConcurrencyToken()
|
|
.IsRequired()
|
|
.ValueGeneratedOnAddOrUpdate()
|
|
.HasColumnType("rowversion");
|
|
|
|
b.Property<string>("Type")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("Value")
|
|
.IsRequired()
|
|
.HasMaxLength(2147483647)
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("EntityId", "KeyGroup", "Key");
|
|
|
|
b.HasIndex("DeletedOn")
|
|
.HasDatabaseName("IX_GenericAttributes_Active")
|
|
.HasFilter("[DeletedOn] IS NULL");
|
|
|
|
b.HasIndex("EntityId", "KeyGroup")
|
|
.HasDatabaseName("IX_GenericAttributes_Entity_Group");
|
|
|
|
b.ToTable("GenericAttributes");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Data.Entities.SeederLog", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("RunAt")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<string>("RunMode")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("nvarchar(64)");
|
|
|
|
b.Property<string>("SeederName")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("nvarchar(256)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("SeederLogs");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.OptionDefinition", b =>
|
|
{
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.Product", "Product")
|
|
.WithMany("Options")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.OptionRuleCondition", b =>
|
|
{
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.OptionDefinition", "LeftOptionDefinition")
|
|
.WithMany()
|
|
.HasForeignKey("LeftOptionDefinitionId")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.OptionValue", "RightOptionValue")
|
|
.WithMany()
|
|
.HasForeignKey("RightOptionValueId")
|
|
.OnDelete(DeleteBehavior.NoAction);
|
|
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.OptionRuleSet", "RuleSet")
|
|
.WithMany("Conditions")
|
|
.HasForeignKey("RuleSetId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("LeftOptionDefinition");
|
|
|
|
b.Navigation("RightOptionValue");
|
|
|
|
b.Navigation("RuleSet");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.OptionRuleSet", b =>
|
|
{
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.Product", "Product")
|
|
.WithMany("RuleSets")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.OptionTier", b =>
|
|
{
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.OptionDefinition", "OptionDefinition")
|
|
.WithMany("Tiers")
|
|
.HasForeignKey("OptionDefinitionId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("OptionDefinition");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.OptionValue", b =>
|
|
{
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.OptionDefinition", "OptionDefinition")
|
|
.WithMany("Values")
|
|
.HasForeignKey("OptionDefinitionId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("OptionDefinition");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.Product", b =>
|
|
{
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.Product", "ParentProduct")
|
|
.WithMany("Variants")
|
|
.HasForeignKey("ParentProductId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.Navigation("ParentProduct");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.ProductAttributeValue", b =>
|
|
{
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.AttributeDefinition", "AttributeDefinition")
|
|
.WithMany()
|
|
.HasForeignKey("AttributeDefinitionId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.Product", "Product")
|
|
.WithMany("Attributes")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("AttributeDefinition");
|
|
|
|
b.Navigation("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.ProductCategory", b =>
|
|
{
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.Category", "Category")
|
|
.WithMany()
|
|
.HasForeignKey("CategoryId")
|
|
.OnDelete(DeleteBehavior.Restrict)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.Product", "Product")
|
|
.WithMany("Categories")
|
|
.HasForeignKey("ProductId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Category");
|
|
|
|
b.Navigation("Product");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.VariantAxisValue", b =>
|
|
{
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.OptionDefinition", "OptionDefinition")
|
|
.WithMany()
|
|
.HasForeignKey("OptionDefinitionId")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.OptionValue", "OptionValue")
|
|
.WithMany()
|
|
.HasForeignKey("OptionValueId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Prefab.Catalog.Domain.Entities.Product", "ProductVariant")
|
|
.WithMany("AxisValues")
|
|
.HasForeignKey("ProductVariantId")
|
|
.OnDelete(DeleteBehavior.NoAction)
|
|
.IsRequired();
|
|
|
|
b.Navigation("OptionDefinition");
|
|
|
|
b.Navigation("OptionValue");
|
|
|
|
b.Navigation("ProductVariant");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Data.Entities.AuditLogItem", b =>
|
|
{
|
|
b.HasOne("Prefab.Data.Entities.AuditLog", "AuditLog")
|
|
.WithMany("Items")
|
|
.HasForeignKey("AuditLogId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("AuditLog");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.OptionDefinition", b =>
|
|
{
|
|
b.Navigation("Tiers");
|
|
|
|
b.Navigation("Values");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.OptionRuleSet", b =>
|
|
{
|
|
b.Navigation("Conditions");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Catalog.Domain.Entities.Product", b =>
|
|
{
|
|
b.Navigation("Attributes");
|
|
|
|
b.Navigation("AxisValues");
|
|
|
|
b.Navigation("Categories");
|
|
|
|
b.Navigation("Options");
|
|
|
|
b.Navigation("RuleSets");
|
|
|
|
b.Navigation("Variants");
|
|
});
|
|
|
|
modelBuilder.Entity("Prefab.Data.Entities.AuditLog", b =>
|
|
{
|
|
b.Navigation("Items");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|