// using Infrastructure.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable namespace Infrastructure.Data.Migrations { [DbContext(typeof(StoreContext))] [Migration("20220510050050_InitialCreate")] partial class InitialCreate { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder.HasAnnotation("ProductVersion", "6.0.4"); modelBuilder.Entity("Core.Entities.Product", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Description") .IsRequired() .HasMaxLength(256) .HasColumnType("TEXT"); b.Property("Name") .IsRequired() .HasMaxLength(100) .HasColumnType("TEXT"); b.Property("PictureUrl") .IsRequired() .HasColumnType("TEXT"); b.Property("Price") .HasColumnType("decimal(18,2)"); b.Property("ProductBrandId") .HasColumnType("INTEGER"); b.Property("ProductTypeId") .HasColumnType("INTEGER"); b.HasKey("Id"); b.HasIndex("ProductBrandId"); b.HasIndex("ProductTypeId"); b.ToTable("Products"); }); modelBuilder.Entity("Core.Entities.ProductBrand", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Name") .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("ProductBrands"); }); modelBuilder.Entity("Core.Entities.ProductType", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("INTEGER"); b.Property("Name") .HasColumnType("TEXT"); b.HasKey("Id"); b.ToTable("ProductTypes"); }); modelBuilder.Entity("Core.Entities.Product", b => { b.HasOne("Core.Entities.ProductBrand", "ProductBrand") .WithMany() .HasForeignKey("ProductBrandId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Core.Entities.ProductType", "ProductType") .WithMany() .HasForeignKey("ProductTypeId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("ProductBrand"); b.Navigation("ProductType"); }); #pragma warning restore 612, 618 } } }