// 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("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("IsBundle") .HasColumnType("boolean"); b.Property("ParentCategoryId") .HasColumnType("uuid"); b.PrimitiveCollection("Photos") .IsRequired() .HasColumnType("text[]"); b.HasKey("Id"); b.HasIndex("ParentCategoryId"); b.ToTable("Categories"); }); modelBuilder.Entity("Commerce.Domain.Entities.Product", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CategoryId") .HasColumnType("uuid"); b.Property("CategoryName") .HasColumnType("text"); b.Property("CodeName") .IsRequired() .HasColumnType("text"); b.Property("Created") .HasColumnType("timestamp with time zone"); b.Property("Discount") .HasColumnType("double precision"); b.Property("IsBundle") .HasColumnType("boolean"); b.PrimitiveCollection("Photos") .IsRequired() .HasColumnType("text[]"); b.Property("Price") .HasColumnType("double precision"); b.HasKey("Id"); b.HasIndex("CategoryId"); b.ToTable("Products"); }); modelBuilder.Entity("ProductProduct", b => { b.Property("ChildProductsId") .HasColumnType("uuid"); b.Property("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("CategoryId") .HasColumnType("uuid"); b1.Property("__synthesizedOrdinal") .ValueGeneratedOnAdd() .HasColumnType("integer"); b1.Property("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("CategoryTranslationCategoryId") .HasColumnType("uuid"); b2.Property("CategoryTranslation__synthesizedOrdinal") .HasColumnType("integer"); b2.Property("Description") .IsRequired() .HasColumnType("text"); b2.Property("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("CategoryInfoCategoryTranslationCategoryId") .HasColumnType("uuid"); b3.Property("CategoryInfoCategoryTranslation__synthesizedOrdinal") .HasColumnType("integer"); b3.Property("__synthesizedOrdinal") .ValueGeneratedOnAdd() .HasColumnType("integer"); b3.Property("Key") .IsRequired() .HasColumnType("text"); b3.Property("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("ProductId") .HasColumnType("uuid"); b1.Property("__synthesizedOrdinal") .ValueGeneratedOnAdd() .HasColumnType("integer"); b1.Property("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("ProductTranslationProductId") .HasColumnType("uuid"); b2.Property("ProductTranslation__synthesizedOrdinal") .HasColumnType("integer"); b2.Property("Description") .IsRequired() .HasColumnType("text"); b2.Property("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("ProductInfoProductTranslationProductId") .HasColumnType("uuid"); b3.Property("ProductInfoProductTranslation__synthesizedOrdinal") .HasColumnType("integer"); b3.Property("__synthesizedOrdinal") .ValueGeneratedOnAdd() .HasColumnType("integer"); b3.Property("Key") .IsRequired() .HasColumnType("text"); b3.Property("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 } } }