// using System; using Demo2.Context; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace Demo2.Migrations { [DbContext(typeof(Context.Context))] partial class IsajkinContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "7.0.20") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("Attachedproduct", b => { b.Property("Mainproductid") .HasColumnType("integer") .HasColumnName("mainproductid"); b.Property("Attachedproductid") .HasColumnType("integer") .HasColumnName("attachedproductid"); b.HasKey("Mainproductid", "Attachedproductid") .HasName("attachedproduct_pkey"); b.HasIndex("Attachedproductid"); b.ToTable("attachedproduct", "task16-09"); }); modelBuilder.Entity("Demo2.Models.Client", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Birthday") .HasColumnType("date") .HasColumnName("birthday"); b.Property("Email") .HasMaxLength(255) .HasColumnType("character varying(255)") .HasColumnName("email"); b.Property("Firstname") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)") .HasColumnName("firstname"); b.Property("Gendercode") .HasMaxLength(1) .HasColumnType("character(1)") .HasColumnName("gendercode"); b.Property("Lastname") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)") .HasColumnName("lastname"); b.Property("Patronymic") .HasMaxLength(50) .HasColumnType("character varying(50)") .HasColumnName("patronymic"); b.Property("Phone") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)") .HasColumnName("phone"); b.Property("Photopath") .HasMaxLength(1000) .HasColumnType("character varying(1000)") .HasColumnName("photopath"); b.Property("Registrationdate") .HasColumnType("timestamp(6) without time zone") .HasColumnName("registrationdate"); b.HasKey("Id") .HasName("client_pkey"); b.HasIndex("Gendercode"); b.ToTable("client", "task16-09"); }); modelBuilder.Entity("Demo2.Models.Clientservice", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Clientid") .HasColumnType("integer") .HasColumnName("clientid"); b.Property("Comment") .HasColumnType("text") .HasColumnName("comment"); b.Property("Serviceid") .HasColumnType("integer") .HasColumnName("serviceid"); b.Property("Starttime") .HasColumnType("timestamp(6) without time zone") .HasColumnName("starttime"); b.HasKey("Id") .HasName("clientservice_pkey"); b.HasIndex("Clientid"); b.HasIndex("Serviceid"); b.ToTable("clientservice", "task16-09"); }); modelBuilder.Entity("Demo2.Models.Documentbyservice", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Clientserviceid") .HasColumnType("integer") .HasColumnName("clientserviceid"); b.Property("Documentpath") .IsRequired() .HasMaxLength(1000) .HasColumnType("character varying(1000)") .HasColumnName("documentpath"); b.HasKey("Id") .HasName("documentbyservice_pkey"); b.HasIndex("Clientserviceid"); b.ToTable("documentbyservice", "task16-09"); }); modelBuilder.Entity("Demo2.Models.Gender", b => { b.Property("Code") .HasMaxLength(1) .HasColumnType("character(1)") .HasColumnName("code"); b.Property("Name") .HasMaxLength(10) .HasColumnType("character varying(10)") .HasColumnName("name"); b.HasKey("Code") .HasName("gender_pkey"); b.ToTable("gender", "task16-09"); }); modelBuilder.Entity("Demo2.Models.Manufacturer", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Name") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)") .HasColumnName("name"); b.Property("Startdate") .HasColumnType("date") .HasColumnName("startdate"); b.HasKey("Id") .HasName("manufacturer_pkey"); b.ToTable("manufacturer", "task16-09"); }); modelBuilder.Entity("Demo2.Models.Product", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Cost") .HasPrecision(19, 4) .HasColumnType("numeric(19,4)") .HasColumnName("cost"); b.Property("Description") .HasColumnType("text") .HasColumnName("description"); b.Property("Isactive") .HasColumnType("integer") .HasColumnName("isactive"); b.Property("Mainimagepath") .HasMaxLength(1000) .HasColumnType("character varying(1000)") .HasColumnName("mainimagepath"); b.Property("Manufacturerid") .HasColumnType("integer") .HasColumnName("manufacturerid"); b.Property("Title") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)") .HasColumnName("title"); b.HasKey("Id") .HasName("product_pkey"); b.HasIndex("Manufacturerid"); b.ToTable("product", "task16-09"); }); modelBuilder.Entity("Demo2.Models.Productphoto", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Photopath") .IsRequired() .HasMaxLength(1000) .HasColumnType("character varying(1000)") .HasColumnName("photopath"); b.Property("Productid") .HasColumnType("integer") .HasColumnName("productid"); b.HasKey("Id") .HasName("productphoto_pkey"); b.HasIndex("Productid"); b.ToTable("productphoto", "task16-09"); }); modelBuilder.Entity("Demo2.Models.Productsale", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Clientserviceid") .HasColumnType("integer") .HasColumnName("clientserviceid"); b.Property("Productid") .HasColumnType("integer") .HasColumnName("productid"); b.Property("Quantity") .HasColumnType("integer") .HasColumnName("quantity"); b.Property("Saledate") .HasColumnType("timestamp(6) without time zone") .HasColumnName("saledate"); b.HasKey("Id") .HasName("productsale_pkey"); b.HasIndex("Clientserviceid"); b.HasIndex("Productid"); b.ToTable("productsale", "task16-09"); }); modelBuilder.Entity("Demo2.Models.Service", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Cost") .HasPrecision(19, 4) .HasColumnType("numeric(19,4)") .HasColumnName("cost"); b.Property("Description") .HasColumnType("text") .HasColumnName("description"); b.Property("Discount") .HasColumnType("double precision") .HasColumnName("discount"); b.Property("Durationinseconds") .HasColumnType("integer") .HasColumnName("durationinseconds"); b.Property("Mainimagepath") .HasMaxLength(1000) .HasColumnType("character varying(1000)") .HasColumnName("mainimagepath"); b.Property("Title") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)") .HasColumnName("title"); b.HasKey("Id") .HasName("service_pkey"); b.ToTable("service", "task16-09"); }); modelBuilder.Entity("Demo2.Models.Servicephoto", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer") .HasColumnName("id"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Photopath") .IsRequired() .HasMaxLength(1000) .HasColumnType("character varying(1000)") .HasColumnName("photopath"); b.Property("Serviceid") .HasColumnType("integer") .HasColumnName("serviceid"); b.HasKey("Id") .HasName("servicephoto_pkey"); b.HasIndex("Serviceid"); b.ToTable("servicephoto", "task16-09"); }); modelBuilder.Entity("Demo2.Models.Tag", b => { b.Property("Id") .HasColumnType("integer") .HasColumnName("id"); b.Property("Color") .IsRequired() .HasMaxLength(8) .HasColumnType("character(8)") .HasColumnName("color") .IsFixedLength(); b.Property("Title") .IsRequired() .HasMaxLength(30) .HasColumnType("character varying(30)") .HasColumnName("title"); b.HasKey("Id") .HasName("tag_pkey"); b.ToTable("tag", "task16-09"); }); modelBuilder.Entity("Tagofclient", b => { b.Property("Clientid") .HasColumnType("integer") .HasColumnName("clientid"); b.Property("Tagid") .HasColumnType("integer") .HasColumnName("tagid"); b.HasKey("Clientid", "Tagid") .HasName("tagofclient_pkey"); b.HasIndex("Tagid"); b.ToTable("tagofclient", "task16-09"); }); modelBuilder.Entity("Attachedproduct", b => { b.HasOne("Demo2.Models.Product", null) .WithMany() .HasForeignKey("Attachedproductid") .IsRequired() .HasConstraintName("fk_attachedproduct_product1"); b.HasOne("Demo2.Models.Product", null) .WithMany() .HasForeignKey("Mainproductid") .IsRequired() .HasConstraintName("fk_attachedproduct_product"); }); modelBuilder.Entity("Demo2.Models.Client", b => { b.HasOne("Demo2.Models.Gender", "GendercodeNavigation") .WithMany("Clients") .HasForeignKey("Gendercode") .IsRequired() .HasConstraintName("fk_client_gender"); b.Navigation("GendercodeNavigation"); }); modelBuilder.Entity("Demo2.Models.Clientservice", b => { b.HasOne("Demo2.Models.Client", "Client") .WithMany("Clientservices") .HasForeignKey("Clientid") .IsRequired() .HasConstraintName("fk_clientservice_client"); b.HasOne("Demo2.Models.Service", "Service") .WithMany("Clientservices") .HasForeignKey("Serviceid") .IsRequired() .HasConstraintName("fk_clientservice_service"); b.Navigation("Client"); b.Navigation("Service"); }); modelBuilder.Entity("Demo2.Models.Documentbyservice", b => { b.HasOne("Demo2.Models.Clientservice", "Clientservice") .WithMany("Documentbyservices") .HasForeignKey("Clientserviceid") .IsRequired() .HasConstraintName("fk_documentbyservice_clientservice"); b.Navigation("Clientservice"); }); modelBuilder.Entity("Demo2.Models.Product", b => { b.HasOne("Demo2.Models.Manufacturer", "Manufacturer") .WithMany("Products") .HasForeignKey("Manufacturerid") .HasConstraintName("fk_product_manufacturer"); b.Navigation("Manufacturer"); }); modelBuilder.Entity("Demo2.Models.Productphoto", b => { b.HasOne("Demo2.Models.Product", "Product") .WithMany("Productphotos") .HasForeignKey("Productid") .IsRequired() .HasConstraintName("fk_productphoto_product"); b.Navigation("Product"); }); modelBuilder.Entity("Demo2.Models.Productsale", b => { b.HasOne("Demo2.Models.Clientservice", "Clientservice") .WithMany("Productsales") .HasForeignKey("Clientserviceid") .HasConstraintName("fk_productsale_clientservice"); b.HasOne("Demo2.Models.Product", "Product") .WithMany("Productsales") .HasForeignKey("Productid") .IsRequired() .HasConstraintName("fk_productsale_product"); b.Navigation("Clientservice"); b.Navigation("Product"); }); modelBuilder.Entity("Demo2.Models.Servicephoto", b => { b.HasOne("Demo2.Models.Service", "Service") .WithMany("Servicephotos") .HasForeignKey("Serviceid") .IsRequired() .HasConstraintName("fk_servicephoto_service"); b.Navigation("Service"); }); modelBuilder.Entity("Tagofclient", b => { b.HasOne("Demo2.Models.Client", null) .WithMany() .HasForeignKey("Clientid") .IsRequired() .HasConstraintName("fk_tagofclient_client"); b.HasOne("Demo2.Models.Tag", null) .WithMany() .HasForeignKey("Tagid") .IsRequired() .HasConstraintName("tagofclient_tag_fk"); }); modelBuilder.Entity("Demo2.Models.Client", b => { b.Navigation("Clientservices"); }); modelBuilder.Entity("Demo2.Models.Clientservice", b => { b.Navigation("Documentbyservices"); b.Navigation("Productsales"); }); modelBuilder.Entity("Demo2.Models.Gender", b => { b.Navigation("Clients"); }); modelBuilder.Entity("Demo2.Models.Manufacturer", b => { b.Navigation("Products"); }); modelBuilder.Entity("Demo2.Models.Product", b => { b.Navigation("Productphotos"); b.Navigation("Productsales"); }); modelBuilder.Entity("Demo2.Models.Service", b => { b.Navigation("Clientservices"); b.Navigation("Servicephotos"); }); #pragma warning restore 612, 618 } } }