// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using data; #nullable disable namespace data.Migrations { [DbContext(typeof(RemoteDatabaseContext))] [Migration("20241212071851_InitialCreate2")] partial class InitialCreate2 { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "8.0.10") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("Data.DAO.Attendance", b => { b.Property("AttendanceId") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("AttendanceId")); b.Property("Date") .HasColumnType("date"); b.Property("GroupId") .HasColumnType("integer"); b.Property("GroupSubjectId") .HasColumnType("integer"); b.Property("LessonNumber") .HasColumnType("integer"); b.Property("StudentId") .HasColumnType("integer"); b.Property("VisitId") .HasColumnType("integer"); b.HasKey("AttendanceId"); b.HasIndex("GroupId"); b.HasIndex("GroupSubjectId"); b.HasIndex("StudentId"); b.HasIndex("VisitId"); b.ToTable("Attendances"); }); modelBuilder.Entity("Data.DAO.Group", b => { b.Property("GroupId") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("GroupId")); b.Property("GroupName") .IsRequired() .HasColumnType("text"); b.HasKey("GroupId"); b.ToTable("Groups"); }); modelBuilder.Entity("Data.DAO.GroupSubject", b => { b.Property("GroupSubjectId") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("GroupSubjectId")); b.Property("GroupId") .HasColumnType("integer"); b.Property("SemesterId") .HasColumnType("integer"); b.Property("SubjectId") .HasColumnType("integer"); b.HasKey("GroupSubjectId"); b.HasIndex("GroupId"); b.HasIndex("SemesterId"); b.HasIndex("SubjectId"); b.ToTable("GroupSubjects"); }); modelBuilder.Entity("Data.DAO.Semester", b => { b.Property("SemesterId") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("SemesterId")); b.Property("EndTime") .HasColumnType("timestamp with time zone"); b.Property("StartTime") .HasColumnType("timestamp with time zone"); b.HasKey("SemesterId"); b.ToTable("Semesters"); }); modelBuilder.Entity("Data.DAO.Student", b => { b.Property("StudentId") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("StudentId")); b.Property("FirstName") .IsRequired() .HasColumnType("text"); b.Property("GroupId") .HasColumnType("integer"); b.Property("LastName") .IsRequired() .HasColumnType("text"); b.Property("Patronymic") .IsRequired() .HasColumnType("text"); b.HasKey("StudentId"); b.HasIndex("GroupId"); b.ToTable("Students"); }); modelBuilder.Entity("Data.DAO.Subject", b => { b.Property("SubjectId") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("SubjectId")); b.Property("GroupId") .HasColumnType("integer"); b.Property("SubjectName") .IsRequired() .HasColumnType("text"); b.HasKey("SubjectId"); b.HasIndex("GroupId"); b.ToTable("Subjects"); }); modelBuilder.Entity("Data.DAO.Visit", b => { b.Property("VisitId") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("VisitId")); b.Property("VisitName") .IsRequired() .HasColumnType("text"); b.HasKey("VisitId"); b.ToTable("Visits"); }); modelBuilder.Entity("Data.DAO.Attendance", b => { b.HasOne("Data.DAO.Group", "Group") .WithMany() .HasForeignKey("GroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Data.DAO.GroupSubject", "GroupSubject") .WithMany("Attendances") .HasForeignKey("GroupSubjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Data.DAO.Student", "Student") .WithMany("Attendances") .HasForeignKey("StudentId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Data.DAO.Visit", "Visit") .WithMany("Attendances") .HasForeignKey("VisitId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Group"); b.Navigation("GroupSubject"); b.Navigation("Student"); b.Navigation("Visit"); }); modelBuilder.Entity("Data.DAO.GroupSubject", b => { b.HasOne("Data.DAO.Group", "Group") .WithMany("GroupSubjects") .HasForeignKey("GroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Data.DAO.Semester", "Semester") .WithMany("GroupSubjects") .HasForeignKey("SemesterId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Data.DAO.Subject", "Subject") .WithMany("GroupSubjects") .HasForeignKey("SubjectId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Group"); b.Navigation("Semester"); b.Navigation("Subject"); }); modelBuilder.Entity("Data.DAO.Student", b => { b.HasOne("Data.DAO.Group", "Group") .WithMany("Students") .HasForeignKey("GroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Group"); }); modelBuilder.Entity("Data.DAO.Subject", b => { b.HasOne("Data.DAO.Group", "Group") .WithMany("Subjects") .HasForeignKey("GroupId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Group"); }); modelBuilder.Entity("Data.DAO.Group", b => { b.Navigation("GroupSubjects"); b.Navigation("Students"); b.Navigation("Subjects"); }); modelBuilder.Entity("Data.DAO.GroupSubject", b => { b.Navigation("Attendances"); }); modelBuilder.Entity("Data.DAO.Semester", b => { b.Navigation("GroupSubjects"); }); modelBuilder.Entity("Data.DAO.Student", b => { b.Navigation("Attendances"); }); modelBuilder.Entity("Data.DAO.Subject", b => { b.Navigation("GroupSubjects"); }); modelBuilder.Entity("Data.DAO.Visit", b => { b.Navigation("Attendances"); }); #pragma warning restore 612, 618 } } }