// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using UniversityDataBaseImplemet; #nullable disable namespace UniversityDataBaseImplemet.Migrations { [DbContext(typeof(Database))] [Migration("20230516175336_fixRole")] partial class fixRole { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "7.0.5") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("UniversityDataBaseImplemet.Models.Discipline", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Hours") .HasColumnType("integer"); b.Property("MarkType") .HasColumnType("boolean"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("StreamId") .HasColumnType("integer"); b.Property("UserId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("StreamId"); b.HasIndex("UserId"); b.ToTable("Discipline"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.Document", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Date") .HasColumnType("timestamp with time zone"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("UserId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("Documents"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("NumberOfStudent") .HasColumnType("integer"); b.Property("UserId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("EducationGroups"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupDocument", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("DocumentId") .HasColumnType("integer"); b.Property("EducationGroupId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("DocumentId"); b.HasIndex("EducationGroupId"); b.ToTable("EducationGroupsDocuments"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupStream", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("EducationGroupId") .HasColumnType("integer"); b.Property("StreamId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("EducationGroupId"); b.HasIndex("StreamId"); b.ToTable("EducationGroupsStreams"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationStatus", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("UserId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("EducationStatuses"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Course") .HasColumnType("integer"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("UserId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("Streams"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("DateOfBirth") .HasColumnType("timestamp with time zone"); b.Property("EducationStatusId") .HasColumnType("integer"); b.Property("Name") .IsRequired() .HasColumnType("text"); b.Property("StudentCard") .HasColumnType("integer"); b.Property("Surname") .IsRequired() .HasColumnType("text"); b.Property("UserId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("EducationStatusId"); b.HasIndex("UserId"); b.ToTable("Students"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentDocument", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("DocumentId") .HasColumnType("integer"); b.Property("StudentId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("DocumentId"); b.HasIndex("StudentId"); b.ToTable("StudentDocuments"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentStream", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("StreamId") .HasColumnType("integer"); b.Property("StudentId") .HasColumnType("integer"); b.HasKey("Id"); b.HasIndex("StreamId"); b.HasIndex("StudentId"); b.ToTable("StudentStreams"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Login") .IsRequired() .HasColumnType("text"); b.Property("Password") .IsRequired() .HasColumnType("text"); b.Property("Role") .HasColumnType("integer"); b.HasKey("Id"); b.ToTable("User"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.Discipline", b => { b.HasOne("UniversityDataBaseImplemet.Models.Stream", "Stream") .WithMany() .HasForeignKey("StreamId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("UniversityDataBaseImplemet.Models.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Stream"); b.Navigation("User"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.Document", b => { b.HasOne("UniversityDataBaseImplemet.Models.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("User"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b => { b.HasOne("UniversityDataBaseImplemet.Models.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("User"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupDocument", b => { b.HasOne("UniversityDataBaseImplemet.Models.Document", "Document") .WithMany("EducationGroupDocument") .HasForeignKey("DocumentId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("UniversityDataBaseImplemet.Models.EducationGroup", "EducationGroup") .WithMany("EducationGroupDocument") .HasForeignKey("EducationGroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Document"); b.Navigation("EducationGroup"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupStream", b => { b.HasOne("UniversityDataBaseImplemet.Models.EducationGroup", "EducationGroup") .WithMany("EducationGroupStream") .HasForeignKey("EducationGroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("UniversityDataBaseImplemet.Models.Stream", "Stream") .WithMany("EducationGroupStream") .HasForeignKey("StreamId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("EducationGroup"); b.Navigation("Stream"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationStatus", b => { b.HasOne("UniversityDataBaseImplemet.Models.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("User"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b => { b.HasOne("UniversityDataBaseImplemet.Models.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("User"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b => { b.HasOne("UniversityDataBaseImplemet.Models.EducationStatus", "EducationStatus") .WithMany("Students") .HasForeignKey("EducationStatusId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("UniversityDataBaseImplemet.Models.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("EducationStatus"); b.Navigation("User"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentDocument", b => { b.HasOne("UniversityDataBaseImplemet.Models.Document", "Document") .WithMany("Students") .HasForeignKey("DocumentId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("UniversityDataBaseImplemet.Models.Student", "Student") .WithMany("DocumentStudents") .HasForeignKey("StudentId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Document"); b.Navigation("Student"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentStream", b => { b.HasOne("UniversityDataBaseImplemet.Models.Stream", "Stream") .WithMany("StreamStudents") .HasForeignKey("StreamId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("UniversityDataBaseImplemet.Models.Student", "Student") .WithMany("StudentStream") .HasForeignKey("StudentId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Stream"); b.Navigation("Student"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.Document", b => { b.Navigation("EducationGroupDocument"); b.Navigation("Students"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b => { b.Navigation("EducationGroupDocument"); b.Navigation("EducationGroupStream"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationStatus", b => { b.Navigation("Students"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b => { b.Navigation("EducationGroupStream"); b.Navigation("StreamStudents"); }); modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b => { b.Navigation("DocumentStudents"); b.Navigation("StudentStream"); }); #pragma warning restore 612, 618 } } }