// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using UniversityDatabaseImplement; #nullable disable namespace UniversityDatabaseImplement.Migrations { [DbContext(typeof(UniversityDB))] [Migration("20230515153721_Init")] partial class Init { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "7.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("UniversityDatabaseImplement.Models.Account", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClientByDisciplineId") .HasColumnType("integer"); b.Property("DateOfAccount") .HasColumnType("date"); b.Property("Price") .HasColumnType("double precision"); b.HasKey("Id"); b.HasIndex("ClientByDisciplineId"); b.ToTable("Accounts"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.Client", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Course") .HasColumnType("integer"); b.Property("DirectorId") .HasColumnType("integer"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("Price") .HasColumnType("double precision"); b.HasKey("Id"); b.HasIndex("DirectorId"); b.ToTable("Clients"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.ClientByDiscipline", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClientId") .HasColumnType("integer"); b.Property("DateOfClient") .HasColumnType("timestamp with time zone"); b.Property("DisciplineId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("ClientId"); b.HasIndex("DisciplineId"); b.ToTable("ClientsByDisciplines"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.Director", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("FirstName") .IsRequired() .HasColumnType("text"); b.Property("LastName") .IsRequired() .HasColumnType("text"); b.Property("Login") .IsRequired() .HasColumnType("text"); b.Property("Password") .IsRequired() .HasColumnType("text"); b.Property("PhoneNumber") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.ToTable("Directors"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.Discipline", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("DateOfPassage") .HasColumnType("date"); b.Property("DateOfReceipt") .HasColumnType("date"); b.Property("ImplementerId") .HasColumnType("integer"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("Price") .HasColumnType("double precision"); b.HasKey("Id"); b.HasIndex("ImplementerId"); b.ToTable("Disciplines"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.Implementer", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("FirstName") .IsRequired() .HasColumnType("text"); b.Property("LastName") .IsRequired() .HasColumnType("text"); b.Property("Login") .IsRequired() .HasColumnType("text"); b.Property("Password") .IsRequired() .HasColumnType("text"); b.Property("PhoneNumber") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.ToTable("Implementers"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.Requirement", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("DirectorId") .HasColumnType("integer"); b.Property("NameOfRequirement") .IsRequired() .HasColumnType("text"); b.Property("Price") .HasColumnType("double precision"); b.HasKey("Id"); b.HasIndex("DirectorId"); b.ToTable("Requirements"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.RequirementByDiscipline", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Count") .HasColumnType("integer"); b.Property("DisciplineId") .HasColumnType("integer"); b.Property("RequirementId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("DisciplineId"); b.HasIndex("RequirementId"); b.ToTable("RequirementByDisciplines"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.Account", b => { b.HasOne("UniversityDatabaseImplement.Models.ClientByDiscipline", "ClientByDiscipline") .WithMany("Accounts") .HasForeignKey("ClientByDisciplineId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("ClientByDiscipline"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.Client", b => { b.HasOne("UniversityDatabaseImplement.Models.Director", "Director") .WithMany("Clients") .HasForeignKey("DirectorId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Director"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.ClientByDiscipline", b => { b.HasOne("UniversityDatabaseImplement.Models.Client", "Client") .WithMany("Disciplines") .HasForeignKey("ClientId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("UniversityDatabaseImplement.Models.Discipline", "Discipline") .WithMany("Clients") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Client"); b.Navigation("Discipline"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.Discipline", b => { b.HasOne("UniversityDatabaseImplement.Models.Implementer", "Client") .WithMany("Disciplines") .HasForeignKey("ImplementerId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Client"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.Requirement", b => { b.HasOne("UniversityDatabaseImplement.Models.Director", "Director") .WithMany("Requirements") .HasForeignKey("DirectorId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Director"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.RequirementByDiscipline", b => { b.HasOne("UniversityDatabaseImplement.Models.Discipline", "Discipline") .WithMany("Requirements") .HasForeignKey("DisciplineId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("UniversityDatabaseImplement.Models.Requirement", "Requirement") .WithMany("Disciplines") .HasForeignKey("RequirementId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Discipline"); b.Navigation("Requirement"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.Client", b => { b.Navigation("Disciplines"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.ClientByDiscipline", b => { b.Navigation("Accounts"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.Director", b => { b.Navigation("Clients"); b.Navigation("Requirements"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.Discipline", b => { b.Navigation("Clients"); b.Navigation("Requirements"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.Implementer", b => { b.Navigation("Disciplines"); }); modelBuilder.Entity("UniversityDatabaseImplement.Models.Requirement", b => { b.Navigation("Disciplines"); }); #pragma warning restore 612, 618 } } }