307 lines
13 KiB
C#
307 lines
13 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Commerce.Domain;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace Commerce.Domain.Migrations
|
|
{
|
|
[DbContext(typeof(Context))]
|
|
partial class ContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "9.0.5")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("Commerce.Domain.Entities.Category", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<bool>("IsBundle")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<Guid?>("ParentCategoryId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.PrimitiveCollection<string[]>("Photos")
|
|
.IsRequired()
|
|
.HasColumnType("text[]");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ParentCategoryId");
|
|
|
|
b.ToTable("Categories");
|
|
});
|
|
|
|
modelBuilder.Entity("Commerce.Domain.Entities.Product", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid?>("CategoryId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("CategoryName")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("CodeName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("Created")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<double>("Discount")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<bool>("IsBundle")
|
|
.HasColumnType("boolean");
|
|
|
|
b.PrimitiveCollection<string[]>("Photos")
|
|
.IsRequired()
|
|
.HasColumnType("text[]");
|
|
|
|
b.Property<double>("Price")
|
|
.HasColumnType("double precision");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.ToTable("Products");
|
|
});
|
|
|
|
modelBuilder.Entity("ProductProduct", b =>
|
|
{
|
|
b.Property<Guid>("ChildProductsId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("ParentBundlesId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("ChildProductsId", "ParentBundlesId");
|
|
|
|
b.HasIndex("ParentBundlesId");
|
|
|
|
b.ToTable("ProductProduct");
|
|
});
|
|
|
|
modelBuilder.Entity("Commerce.Domain.Entities.Category", b =>
|
|
{
|
|
b.HasOne("Commerce.Domain.Entities.Category", "ParentCategory")
|
|
.WithMany("ChildCategories")
|
|
.HasForeignKey("ParentCategoryId");
|
|
|
|
b.OwnsMany("Commerce.Domain.Entities.CategoryTranslation", "Translations", b1 =>
|
|
{
|
|
b1.Property<Guid>("CategoryId")
|
|
.HasColumnType("uuid");
|
|
|
|
b1.Property<int>("__synthesizedOrdinal")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
b1.Property<string>("Language")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b1.HasKey("CategoryId", "__synthesizedOrdinal");
|
|
|
|
b1.ToTable("Categories");
|
|
|
|
b1.ToJson("Translations");
|
|
|
|
b1.WithOwner()
|
|
.HasForeignKey("CategoryId");
|
|
|
|
b1.OwnsOne("Commerce.Domain.Entities.CategoryInfo", "Info", b2 =>
|
|
{
|
|
b2.Property<Guid>("CategoryTranslationCategoryId")
|
|
.HasColumnType("uuid");
|
|
|
|
b2.Property<int>("CategoryTranslation__synthesizedOrdinal")
|
|
.HasColumnType("integer");
|
|
|
|
b2.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b2.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b2.HasKey("CategoryTranslationCategoryId", "CategoryTranslation__synthesizedOrdinal");
|
|
|
|
b2.ToTable("Categories");
|
|
|
|
b2.WithOwner()
|
|
.HasForeignKey("CategoryTranslationCategoryId", "CategoryTranslation__synthesizedOrdinal");
|
|
|
|
b2.OwnsMany("Commerce.Domain.Entities.TechnicalDetail", "TechnicalDetails", b3 =>
|
|
{
|
|
b3.Property<Guid>("CategoryInfoCategoryTranslationCategoryId")
|
|
.HasColumnType("uuid");
|
|
|
|
b3.Property<int>("CategoryInfoCategoryTranslation__synthesizedOrdinal")
|
|
.HasColumnType("integer");
|
|
|
|
b3.Property<int>("__synthesizedOrdinal")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
b3.Property<string>("Key")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b3.Property<string>("Value")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b3.HasKey("CategoryInfoCategoryTranslationCategoryId", "CategoryInfoCategoryTranslation__synthesizedOrdinal", "__synthesizedOrdinal");
|
|
|
|
b3.ToTable("Categories");
|
|
|
|
b3.WithOwner()
|
|
.HasForeignKey("CategoryInfoCategoryTranslationCategoryId", "CategoryInfoCategoryTranslation__synthesizedOrdinal");
|
|
});
|
|
|
|
b2.Navigation("TechnicalDetails");
|
|
});
|
|
|
|
b1.Navigation("Info")
|
|
.IsRequired();
|
|
});
|
|
|
|
b.Navigation("ParentCategory");
|
|
|
|
b.Navigation("Translations");
|
|
});
|
|
|
|
modelBuilder.Entity("Commerce.Domain.Entities.Product", b =>
|
|
{
|
|
b.HasOne("Commerce.Domain.Entities.Category", "Category")
|
|
.WithMany()
|
|
.HasForeignKey("CategoryId");
|
|
|
|
b.OwnsMany("Commerce.Domain.Entities.ProductTranslation", "Translations", b1 =>
|
|
{
|
|
b1.Property<Guid>("ProductId")
|
|
.HasColumnType("uuid");
|
|
|
|
b1.Property<int>("__synthesizedOrdinal")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
b1.Property<string>("Language")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b1.HasKey("ProductId", "__synthesizedOrdinal");
|
|
|
|
b1.ToTable("Products");
|
|
|
|
b1.ToJson("Translations");
|
|
|
|
b1.WithOwner()
|
|
.HasForeignKey("ProductId");
|
|
|
|
b1.OwnsOne("Commerce.Domain.Entities.ProductInfo", "Info", b2 =>
|
|
{
|
|
b2.Property<Guid>("ProductTranslationProductId")
|
|
.HasColumnType("uuid");
|
|
|
|
b2.Property<int>("ProductTranslation__synthesizedOrdinal")
|
|
.HasColumnType("integer");
|
|
|
|
b2.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b2.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b2.HasKey("ProductTranslationProductId", "ProductTranslation__synthesizedOrdinal");
|
|
|
|
b2.ToTable("Products");
|
|
|
|
b2.WithOwner()
|
|
.HasForeignKey("ProductTranslationProductId", "ProductTranslation__synthesizedOrdinal");
|
|
|
|
b2.OwnsMany("Commerce.Domain.Entities.TechnicalDetail", "TechnicalDetails", b3 =>
|
|
{
|
|
b3.Property<Guid>("ProductInfoProductTranslationProductId")
|
|
.HasColumnType("uuid");
|
|
|
|
b3.Property<int>("ProductInfoProductTranslation__synthesizedOrdinal")
|
|
.HasColumnType("integer");
|
|
|
|
b3.Property<int>("__synthesizedOrdinal")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
b3.Property<string>("Key")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b3.Property<string>("Value")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b3.HasKey("ProductInfoProductTranslationProductId", "ProductInfoProductTranslation__synthesizedOrdinal", "__synthesizedOrdinal");
|
|
|
|
b3.ToTable("Products");
|
|
|
|
b3.WithOwner()
|
|
.HasForeignKey("ProductInfoProductTranslationProductId", "ProductInfoProductTranslation__synthesizedOrdinal");
|
|
});
|
|
|
|
b2.Navigation("TechnicalDetails");
|
|
});
|
|
|
|
b1.Navigation("Info")
|
|
.IsRequired();
|
|
});
|
|
|
|
b.Navigation("Category");
|
|
|
|
b.Navigation("Translations");
|
|
});
|
|
|
|
modelBuilder.Entity("ProductProduct", b =>
|
|
{
|
|
b.HasOne("Commerce.Domain.Entities.Product", null)
|
|
.WithMany()
|
|
.HasForeignKey("ChildProductsId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Commerce.Domain.Entities.Product", null)
|
|
.WithMany()
|
|
.HasForeignKey("ParentBundlesId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Commerce.Domain.Entities.Category", b =>
|
|
{
|
|
b.Navigation("ChildCategories");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|