381 lines
13 KiB
C#
381 lines
13 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using GradeBookServer.Infrastructure.Data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace GradeBookServer.Infrastructure.Migrations
|
|
{
|
|
[DbContext(typeof(ApplicationDbContext))]
|
|
[Migration("20250525163835_AllBD")]
|
|
partial class AllBD
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "9.0.5")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("DirectionDiscipline", b =>
|
|
{
|
|
b.Property<int>("DirectionsID")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("DisciplinesID")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("DirectionsID", "DisciplinesID");
|
|
|
|
b.HasIndex("DisciplinesID");
|
|
|
|
b.ToTable("DirectionDiscipline");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Direction", b =>
|
|
{
|
|
b.Property<int>("ID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ID"));
|
|
|
|
b.Property<int>("FacultyID")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("ID");
|
|
|
|
b.HasIndex("FacultyID");
|
|
|
|
b.ToTable("Directions");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Discipline", b =>
|
|
{
|
|
b.Property<int>("ID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ID"));
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("TotalHours")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("ID");
|
|
|
|
b.ToTable("Disciplines");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Faculty", b =>
|
|
{
|
|
b.Property<int>("ID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ID"));
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("ID");
|
|
|
|
b.ToTable("Faculties");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Grade", b =>
|
|
{
|
|
b.Property<int>("ID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ID"));
|
|
|
|
b.Property<int>("GradeValue")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("StudentID")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("VedomostID")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("ID");
|
|
|
|
b.HasIndex("StudentID");
|
|
|
|
b.HasIndex("VedomostID");
|
|
|
|
b.ToTable("Grades");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Group", b =>
|
|
{
|
|
b.Property<int>("ID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ID"));
|
|
|
|
b.Property<int>("DirectionID")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("ID");
|
|
|
|
b.HasIndex("DirectionID");
|
|
|
|
b.ToTable("Groups");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Student", b =>
|
|
{
|
|
b.Property<int>("ID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ID"));
|
|
|
|
b.Property<int>("Age")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("FullName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("GroupID")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("ID");
|
|
|
|
b.HasIndex("GroupID");
|
|
|
|
b.ToTable("Students");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.User", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Email")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Password")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("Role")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Vedomost", b =>
|
|
{
|
|
b.Property<int>("ID")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("ID"));
|
|
|
|
b.Property<DateOnly>("AcademicYear")
|
|
.HasColumnType("date");
|
|
|
|
b.Property<int>("DisciplineID")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("ExamType")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("GroupID")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("Hours")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int?>("ProfessorID")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("Semester")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("ID");
|
|
|
|
b.HasIndex("DisciplineID");
|
|
|
|
b.HasIndex("GroupID");
|
|
|
|
b.HasIndex("ProfessorID");
|
|
|
|
b.ToTable("Vedomosti");
|
|
});
|
|
|
|
modelBuilder.Entity("DirectionDiscipline", b =>
|
|
{
|
|
b.HasOne("GradeBookServer.Domain.Entities.Direction", null)
|
|
.WithMany()
|
|
.HasForeignKey("DirectionsID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("GradeBookServer.Domain.Entities.Discipline", null)
|
|
.WithMany()
|
|
.HasForeignKey("DisciplinesID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Direction", b =>
|
|
{
|
|
b.HasOne("GradeBookServer.Domain.Entities.Faculty", "Faculty")
|
|
.WithMany("Directions")
|
|
.HasForeignKey("FacultyID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Faculty");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Grade", b =>
|
|
{
|
|
b.HasOne("GradeBookServer.Domain.Entities.Student", "Student")
|
|
.WithMany("Grades")
|
|
.HasForeignKey("StudentID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("GradeBookServer.Domain.Entities.Vedomost", "Vedomost")
|
|
.WithMany("Grades")
|
|
.HasForeignKey("VedomostID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Student");
|
|
|
|
b.Navigation("Vedomost");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Group", b =>
|
|
{
|
|
b.HasOne("GradeBookServer.Domain.Entities.Direction", "Direction")
|
|
.WithMany("Groups")
|
|
.HasForeignKey("DirectionID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Direction");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Student", b =>
|
|
{
|
|
b.HasOne("GradeBookServer.Domain.Entities.Group", "Group")
|
|
.WithMany("Students")
|
|
.HasForeignKey("GroupID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Group");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Vedomost", b =>
|
|
{
|
|
b.HasOne("GradeBookServer.Domain.Entities.Discipline", "Discipline")
|
|
.WithMany("Vedomosti")
|
|
.HasForeignKey("DisciplineID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("GradeBookServer.Domain.Entities.Group", "Group")
|
|
.WithMany("Vedomosti")
|
|
.HasForeignKey("GroupID")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("GradeBookServer.Domain.Entities.User", "Professor")
|
|
.WithMany("Vedomosti")
|
|
.HasForeignKey("ProfessorID");
|
|
|
|
b.Navigation("Discipline");
|
|
|
|
b.Navigation("Group");
|
|
|
|
b.Navigation("Professor");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Direction", b =>
|
|
{
|
|
b.Navigation("Groups");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Discipline", b =>
|
|
{
|
|
b.Navigation("Vedomosti");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Faculty", b =>
|
|
{
|
|
b.Navigation("Directions");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Group", b =>
|
|
{
|
|
b.Navigation("Students");
|
|
|
|
b.Navigation("Vedomosti");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Student", b =>
|
|
{
|
|
b.Navigation("Grades");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.User", b =>
|
|
{
|
|
b.Navigation("Vedomosti");
|
|
});
|
|
|
|
modelBuilder.Entity("GradeBookServer.Domain.Entities.Vedomost", b =>
|
|
{
|
|
b.Navigation("Grades");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|