// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using PlumbingRepairDatabaseImplement; #nullable disable namespace PlumbingRepairDatabaseImplement.Migrations { [DbContext(typeof(PlumbingRepairDataBase))] [Migration("20230416153751_WithImplementer")] partial class WithImplementer { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "7.0.3") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Client", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClientFIO") .IsRequired() .HasColumnType("text"); b.Property("Email") .IsRequired() .HasColumnType("text"); b.Property("Password") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.ToTable("Clients"); }); modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Component", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ComponentName") .IsRequired() .HasColumnType("text"); b.Property("Cost") .HasColumnType("double precision"); b.HasKey("Id"); b.ToTable("Components"); }); modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Implementer", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ImplementerFIO") .IsRequired() .HasColumnType("text"); b.Property("Password") .IsRequired() .HasColumnType("text"); b.Property("Qualification") .HasColumnType("integer"); b.Property("WorkExperience") .HasColumnType("integer"); b.HasKey("Id"); b.ToTable("Implementers"); }); modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Order", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClientId") .HasColumnType("integer"); b.Property("Count") .HasColumnType("integer"); b.Property("DateCreate") .HasColumnType("timestamp with time zone"); b.Property("DateImplement") .HasColumnType("timestamp with time zone"); b.Property("ImplementerId") .HasColumnType("integer"); b.Property("Status") .HasColumnType("integer"); b.Property("Sum") .HasColumnType("double precision"); b.Property("WorkId") .HasColumnType("integer"); b.Property("WorkName") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("ClientId"); b.HasIndex("ImplementerId"); b.HasIndex("WorkId"); b.ToTable("Orders"); }); modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Work", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Price") .HasColumnType("double precision"); b.Property("WorkName") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.ToTable("Works"); }); modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.WorkComponent", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ComponentId") .HasColumnType("integer"); b.Property("Count") .HasColumnType("integer"); b.Property("WorkId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("ComponentId"); b.HasIndex("WorkId"); b.ToTable("WorkComponents"); }); modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Order", b => { b.HasOne("PlumbingRepairDatabaseImplement.Models.Client", "Client") .WithMany("Orders") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PlumbingRepairDatabaseImplement.Models.Implementer", "Implementer") .WithMany("Orders") .HasForeignKey("ImplementerId"); b.HasOne("PlumbingRepairDatabaseImplement.Models.Work", "Work") .WithMany("Orders") .HasForeignKey("WorkId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Client"); b.Navigation("Implementer"); b.Navigation("Work"); }); modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.WorkComponent", b => { b.HasOne("PlumbingRepairDatabaseImplement.Models.Component", "Component") .WithMany("WorkComponents") .HasForeignKey("ComponentId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("PlumbingRepairDatabaseImplement.Models.Work", "Work") .WithMany("Components") .HasForeignKey("WorkId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Component"); b.Navigation("Work"); }); modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Client", b => { b.Navigation("Orders"); }); modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Component", b => { b.Navigation("WorkComponents"); }); modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Implementer", b => { b.Navigation("Orders"); }); modelBuilder.Entity("PlumbingRepairDatabaseImplement.Models.Work", b => { b.Navigation("Components"); b.Navigation("Orders"); }); #pragma warning restore 612, 618 } } }