на этом хватит
This commit is contained in:
parent
f155fd0684
commit
f202ad7898
@ -37,7 +37,21 @@ namespace UniversityDataBaseImplemet.Implements
|
|||||||
public List<DocumentViewModel> GetFilteredList(DocumentSearchModel model)
|
public List<DocumentViewModel> GetFilteredList(DocumentSearchModel model)
|
||||||
{
|
{
|
||||||
using var context = new Database();
|
using var context = new Database();
|
||||||
if (model.Id.HasValue)
|
if (model.UserId.HasValue && model.PageNumber.HasValue && model.PageSize.HasValue)
|
||||||
|
{
|
||||||
|
return context.Documents
|
||||||
|
.Include(record => record.User)
|
||||||
|
.Include(record => record.Students)
|
||||||
|
.ThenInclude(record => record.Student)
|
||||||
|
.Include(record => record.EducationGroupDocument)
|
||||||
|
.ThenInclude(record => record.EducationGroup)
|
||||||
|
.Where(x => x.UserId == model.UserId)
|
||||||
|
.Skip(model.PageSize.Value * (model.PageNumber.Value - 1))
|
||||||
|
.Take(model.PageSize.Value)
|
||||||
|
.Select(x => x.GetViewModel)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
else if (model.Id.HasValue)
|
||||||
{
|
{
|
||||||
return context.Documents
|
return context.Documents
|
||||||
.Include(record => record.User)
|
.Include(record => record.User)
|
||||||
|
@ -31,7 +31,17 @@ namespace UniversityDataBaseImplemet.Implements
|
|||||||
public List<EducationStatusViewModel> GetFilteredList(EducationStatusSearchModel model)
|
public List<EducationStatusViewModel> GetFilteredList(EducationStatusSearchModel model)
|
||||||
{
|
{
|
||||||
using var context = new Database();
|
using var context = new Database();
|
||||||
if (model.Id.HasValue)
|
if (model.UserId.HasValue && model.PageNumber.HasValue && model.PageSize.HasValue)
|
||||||
|
{
|
||||||
|
return context.EducationStatuses
|
||||||
|
.Include(record => record.User)
|
||||||
|
.Where(x => x.UserId == model.UserId)
|
||||||
|
.Skip(model.PageSize.Value * (model.PageNumber.Value - 1))
|
||||||
|
.Take(model.PageSize.Value)
|
||||||
|
.Select(x => x.GetViewModel)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
else if (model.Id.HasValue)
|
||||||
{
|
{
|
||||||
return context.EducationStatuses
|
return context.EducationStatuses
|
||||||
.Include(record => record.User)
|
.Include(record => record.User)
|
||||||
|
@ -1,504 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
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
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
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<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Hours")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<bool>("MarkType")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Discipline");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Document", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("Date")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Documents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("NumberOfStudent")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroups");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("EducationGroupId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("EducationGroupId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationStatus", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationStatuses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Course")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Streams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfBirth")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("EducationStatusId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StudentCard")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Surname")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("EducationStatusId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Students");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("StudentId");
|
|
||||||
|
|
||||||
b.ToTable("StudentDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StudentId");
|
|
||||||
|
|
||||||
b.ToTable("StudentStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Login")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Password")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,394 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace UniversityDataBaseImplemet.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class fixRole : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "User",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
Login = table.Column<string>(type: "text", nullable: false),
|
|
||||||
Password = table.Column<string>(type: "text", nullable: false),
|
|
||||||
Role = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_User", x => x.Id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Documents",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false),
|
|
||||||
Date = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
UserId = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Documents", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_Documents_User_UserId",
|
|
||||||
column: x => x.UserId,
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "EducationGroups",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
NumberOfStudent = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false),
|
|
||||||
UserId = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_EducationGroups", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_EducationGroups_User_UserId",
|
|
||||||
column: x => x.UserId,
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "EducationStatuses",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false),
|
|
||||||
UserId = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_EducationStatuses", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_EducationStatuses_User_UserId",
|
|
||||||
column: x => x.UserId,
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Streams",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false),
|
|
||||||
Course = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
UserId = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Streams", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_Streams_User_UserId",
|
|
||||||
column: x => x.UserId,
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "EducationGroupsDocuments",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
EducationGroupId = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
DocumentId = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_EducationGroupsDocuments", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_EducationGroupsDocuments_Documents_DocumentId",
|
|
||||||
column: x => x.DocumentId,
|
|
||||||
principalTable: "Documents",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_EducationGroupsDocuments_EducationGroups_EducationGroupId",
|
|
||||||
column: x => x.EducationGroupId,
|
|
||||||
principalTable: "EducationGroups",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Students",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false),
|
|
||||||
Surname = table.Column<string>(type: "text", nullable: false),
|
|
||||||
DateOfBirth = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
|
||||||
StudentCard = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
EducationStatusId = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
UserId = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Students", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_Students_EducationStatuses_EducationStatusId",
|
|
||||||
column: x => x.EducationStatusId,
|
|
||||||
principalTable: "EducationStatuses",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_Students_User_UserId",
|
|
||||||
column: x => x.UserId,
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "Discipline",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false),
|
|
||||||
UserId = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
StreamId = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
Hours = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
MarkType = table.Column<bool>(type: "boolean", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_Discipline", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_Discipline_Streams_StreamId",
|
|
||||||
column: x => x.StreamId,
|
|
||||||
principalTable: "Streams",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_Discipline_User_UserId",
|
|
||||||
column: x => x.UserId,
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "EducationGroupsStreams",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
EducationGroupId = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
StreamId = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_EducationGroupsStreams", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_EducationGroupsStreams_EducationGroups_EducationGroupId",
|
|
||||||
column: x => x.EducationGroupId,
|
|
||||||
principalTable: "EducationGroups",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_EducationGroupsStreams_Streams_StreamId",
|
|
||||||
column: x => x.StreamId,
|
|
||||||
principalTable: "Streams",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "StudentDocuments",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
StudentId = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
DocumentId = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_StudentDocuments", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_StudentDocuments_Documents_DocumentId",
|
|
||||||
column: x => x.DocumentId,
|
|
||||||
principalTable: "Documents",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_StudentDocuments_Students_StudentId",
|
|
||||||
column: x => x.StudentId,
|
|
||||||
principalTable: "Students",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "StudentStreams",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
StudentId = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
StreamId = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_StudentStreams", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_StudentStreams_Streams_StreamId",
|
|
||||||
column: x => x.StreamId,
|
|
||||||
principalTable: "Streams",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_StudentStreams_Students_StudentId",
|
|
||||||
column: x => x.StudentId,
|
|
||||||
principalTable: "Students",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Discipline_StreamId",
|
|
||||||
table: "Discipline",
|
|
||||||
column: "StreamId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Discipline_UserId",
|
|
||||||
table: "Discipline",
|
|
||||||
column: "UserId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Documents_UserId",
|
|
||||||
table: "Documents",
|
|
||||||
column: "UserId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_EducationGroups_UserId",
|
|
||||||
table: "EducationGroups",
|
|
||||||
column: "UserId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_EducationGroupsDocuments_DocumentId",
|
|
||||||
table: "EducationGroupsDocuments",
|
|
||||||
column: "DocumentId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_EducationGroupsDocuments_EducationGroupId",
|
|
||||||
table: "EducationGroupsDocuments",
|
|
||||||
column: "EducationGroupId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_EducationGroupsStreams_EducationGroupId",
|
|
||||||
table: "EducationGroupsStreams",
|
|
||||||
column: "EducationGroupId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_EducationGroupsStreams_StreamId",
|
|
||||||
table: "EducationGroupsStreams",
|
|
||||||
column: "StreamId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_EducationStatuses_UserId",
|
|
||||||
table: "EducationStatuses",
|
|
||||||
column: "UserId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Streams_UserId",
|
|
||||||
table: "Streams",
|
|
||||||
column: "UserId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_StudentDocuments_DocumentId",
|
|
||||||
table: "StudentDocuments",
|
|
||||||
column: "DocumentId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_StudentDocuments_StudentId",
|
|
||||||
table: "StudentDocuments",
|
|
||||||
column: "StudentId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Students_EducationStatusId",
|
|
||||||
table: "Students",
|
|
||||||
column: "EducationStatusId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_Students_UserId",
|
|
||||||
table: "Students",
|
|
||||||
column: "UserId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_StudentStreams_StreamId",
|
|
||||||
table: "StudentStreams",
|
|
||||||
column: "StreamId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_StudentStreams_StudentId",
|
|
||||||
table: "StudentStreams",
|
|
||||||
column: "StudentId");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Discipline");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "EducationGroupsDocuments");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "EducationGroupsStreams");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "StudentDocuments");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "StudentStreams");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "EducationGroups");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Documents");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Streams");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "Students");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "EducationStatuses");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "User");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,504 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
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("20230517093341_nullableEdStatusId")]
|
|
||||||
partial class nullableEdStatusId
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
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<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Hours")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<bool>("MarkType")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Discipline");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Document", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("Date")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Documents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("NumberOfStudent")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroups");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("EducationGroupId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("EducationGroupId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationStatus", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationStatuses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Course")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Streams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfBirth")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int>("EducationStatusId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StudentCard")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Surname")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("EducationStatusId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Students");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("StudentId");
|
|
||||||
|
|
||||||
b.ToTable("StudentDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StudentId");
|
|
||||||
|
|
||||||
b.ToTable("StudentStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Login")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Password")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace UniversityDataBaseImplemet.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class nullableEdStatusId : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,505 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
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("20230517094848_nullableEdStatusId2")]
|
|
||||||
partial class nullableEdStatusId2
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
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<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Hours")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<bool>("MarkType")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Discipline");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Document", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("Date")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Documents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("NumberOfStudent")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroups");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("EducationGroupId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("EducationGroupId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationStatus", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationStatuses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Course")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Streams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfBirth")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int?>("EducationStatusId")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StudentCard")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Surname")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("EducationStatusId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Students");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("StudentId");
|
|
||||||
|
|
||||||
b.ToTable("StudentDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StudentId");
|
|
||||||
|
|
||||||
b.ToTable("StudentStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Login")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Password")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace UniversityDataBaseImplemet.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class nullableEdStatusId2 : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,502 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
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("20230517095031_nullableEdStatusId3")]
|
|
||||||
partial class nullableEdStatusId3
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
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<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Hours")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<bool>("MarkType")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Discipline");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Document", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("Date")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Documents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("NumberOfStudent")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroups");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("EducationGroupId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("EducationGroupId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationStatus", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationStatuses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Course")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Streams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfBirth")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int?>("EducationStatusId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StudentCard")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Surname")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("EducationStatusId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Students");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("StudentId");
|
|
||||||
|
|
||||||
b.ToTable("StudentDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StudentId");
|
|
||||||
|
|
||||||
b.ToTable("StudentStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Login")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Password")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("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");
|
|
||||||
|
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,59 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace UniversityDataBaseImplemet.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class nullableEdStatusId3 : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Students_EducationStatuses_EducationStatusId",
|
|
||||||
table: "Students");
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<int>(
|
|
||||||
name: "EducationStatusId",
|
|
||||||
table: "Students",
|
|
||||||
type: "integer",
|
|
||||||
nullable: true,
|
|
||||||
oldClrType: typeof(int),
|
|
||||||
oldType: "integer");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Students_EducationStatuses_EducationStatusId",
|
|
||||||
table: "Students",
|
|
||||||
column: "EducationStatusId",
|
|
||||||
principalTable: "EducationStatuses",
|
|
||||||
principalColumn: "Id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Students_EducationStatuses_EducationStatusId",
|
|
||||||
table: "Students");
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<int>(
|
|
||||||
name: "EducationStatusId",
|
|
||||||
table: "Students",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0,
|
|
||||||
oldClrType: typeof(int),
|
|
||||||
oldType: "integer",
|
|
||||||
oldNullable: true);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Students_EducationStatuses_EducationStatusId",
|
|
||||||
table: "Students",
|
|
||||||
column: "EducationStatusId",
|
|
||||||
principalTable: "EducationStatuses",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,497 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
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("20230518002601_nullableEdStatusId4")]
|
|
||||||
partial class nullableEdStatusId4
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
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<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Hours")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<bool>("MarkType")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Discipline");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Document", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("Date")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Documents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("NumberOfStudent")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroups");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("EducationGroupId", "DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("EducationGroupId", "StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationStatus", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationStatuses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Course")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Streams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfBirth")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int?>("EducationStatusId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StudentCard")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Surname")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("EducationStatusId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Students");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("StudentId", "DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.ToTable("StudentDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("StudentId", "StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("StudentStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Login")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Password")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("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("Disciplines")
|
|
||||||
.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("Documents")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("EducationGroups")
|
|
||||||
.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("EducationStatuses")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("Streams")
|
|
||||||
.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");
|
|
||||||
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("Students")
|
|
||||||
.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");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Disciplines");
|
|
||||||
|
|
||||||
b.Navigation("Documents");
|
|
||||||
|
|
||||||
b.Navigation("EducationGroups");
|
|
||||||
|
|
||||||
b.Navigation("EducationStatuses");
|
|
||||||
|
|
||||||
b.Navigation("Streams");
|
|
||||||
|
|
||||||
b.Navigation("Students");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,222 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace UniversityDataBaseImplemet.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class nullableEdStatusId4 : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Documents_User_UserId",
|
|
||||||
table: "Documents");
|
|
||||||
|
|
||||||
migrationBuilder.DropPrimaryKey(
|
|
||||||
name: "PK_StudentStreams",
|
|
||||||
table: "StudentStreams");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_StudentStreams_StudentId",
|
|
||||||
table: "StudentStreams");
|
|
||||||
|
|
||||||
migrationBuilder.DropPrimaryKey(
|
|
||||||
name: "PK_StudentDocuments",
|
|
||||||
table: "StudentDocuments");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_StudentDocuments_StudentId",
|
|
||||||
table: "StudentDocuments");
|
|
||||||
|
|
||||||
migrationBuilder.DropPrimaryKey(
|
|
||||||
name: "PK_EducationGroupsStreams",
|
|
||||||
table: "EducationGroupsStreams");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_EducationGroupsStreams_EducationGroupId",
|
|
||||||
table: "EducationGroupsStreams");
|
|
||||||
|
|
||||||
migrationBuilder.DropPrimaryKey(
|
|
||||||
name: "PK_EducationGroupsDocuments",
|
|
||||||
table: "EducationGroupsDocuments");
|
|
||||||
|
|
||||||
migrationBuilder.DropIndex(
|
|
||||||
name: "IX_EducationGroupsDocuments_EducationGroupId",
|
|
||||||
table: "EducationGroupsDocuments");
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<int>(
|
|
||||||
name: "Id",
|
|
||||||
table: "StudentStreams",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(int),
|
|
||||||
oldType: "integer")
|
|
||||||
.OldAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<int>(
|
|
||||||
name: "Id",
|
|
||||||
table: "StudentDocuments",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(int),
|
|
||||||
oldType: "integer")
|
|
||||||
.OldAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<int>(
|
|
||||||
name: "Id",
|
|
||||||
table: "EducationGroupsStreams",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(int),
|
|
||||||
oldType: "integer")
|
|
||||||
.OldAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<int>(
|
|
||||||
name: "Id",
|
|
||||||
table: "EducationGroupsDocuments",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(int),
|
|
||||||
oldType: "integer")
|
|
||||||
.OldAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
migrationBuilder.AddPrimaryKey(
|
|
||||||
name: "PK_StudentStreams",
|
|
||||||
table: "StudentStreams",
|
|
||||||
columns: new[] { "StudentId", "StreamId" });
|
|
||||||
|
|
||||||
migrationBuilder.AddPrimaryKey(
|
|
||||||
name: "PK_StudentDocuments",
|
|
||||||
table: "StudentDocuments",
|
|
||||||
columns: new[] { "StudentId", "DocumentId" });
|
|
||||||
|
|
||||||
migrationBuilder.AddPrimaryKey(
|
|
||||||
name: "PK_EducationGroupsStreams",
|
|
||||||
table: "EducationGroupsStreams",
|
|
||||||
columns: new[] { "EducationGroupId", "StreamId" });
|
|
||||||
|
|
||||||
migrationBuilder.AddPrimaryKey(
|
|
||||||
name: "PK_EducationGroupsDocuments",
|
|
||||||
table: "EducationGroupsDocuments",
|
|
||||||
columns: new[] { "EducationGroupId", "DocumentId" });
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Documents_User_UserId",
|
|
||||||
table: "Documents",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Documents_User_UserId",
|
|
||||||
table: "Documents");
|
|
||||||
|
|
||||||
migrationBuilder.DropPrimaryKey(
|
|
||||||
name: "PK_StudentStreams",
|
|
||||||
table: "StudentStreams");
|
|
||||||
|
|
||||||
migrationBuilder.DropPrimaryKey(
|
|
||||||
name: "PK_StudentDocuments",
|
|
||||||
table: "StudentDocuments");
|
|
||||||
|
|
||||||
migrationBuilder.DropPrimaryKey(
|
|
||||||
name: "PK_EducationGroupsStreams",
|
|
||||||
table: "EducationGroupsStreams");
|
|
||||||
|
|
||||||
migrationBuilder.DropPrimaryKey(
|
|
||||||
name: "PK_EducationGroupsDocuments",
|
|
||||||
table: "EducationGroupsDocuments");
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<int>(
|
|
||||||
name: "Id",
|
|
||||||
table: "StudentStreams",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(int),
|
|
||||||
oldType: "integer")
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<int>(
|
|
||||||
name: "Id",
|
|
||||||
table: "StudentDocuments",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(int),
|
|
||||||
oldType: "integer")
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<int>(
|
|
||||||
name: "Id",
|
|
||||||
table: "EducationGroupsStreams",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(int),
|
|
||||||
oldType: "integer")
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
migrationBuilder.AlterColumn<int>(
|
|
||||||
name: "Id",
|
|
||||||
table: "EducationGroupsDocuments",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
oldClrType: typeof(int),
|
|
||||||
oldType: "integer")
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
migrationBuilder.AddPrimaryKey(
|
|
||||||
name: "PK_StudentStreams",
|
|
||||||
table: "StudentStreams",
|
|
||||||
column: "Id");
|
|
||||||
|
|
||||||
migrationBuilder.AddPrimaryKey(
|
|
||||||
name: "PK_StudentDocuments",
|
|
||||||
table: "StudentDocuments",
|
|
||||||
column: "Id");
|
|
||||||
|
|
||||||
migrationBuilder.AddPrimaryKey(
|
|
||||||
name: "PK_EducationGroupsStreams",
|
|
||||||
table: "EducationGroupsStreams",
|
|
||||||
column: "Id");
|
|
||||||
|
|
||||||
migrationBuilder.AddPrimaryKey(
|
|
||||||
name: "PK_EducationGroupsDocuments",
|
|
||||||
table: "EducationGroupsDocuments",
|
|
||||||
column: "Id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_StudentStreams_StudentId",
|
|
||||||
table: "StudentStreams",
|
|
||||||
column: "StudentId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_StudentDocuments_StudentId",
|
|
||||||
table: "StudentDocuments",
|
|
||||||
column: "StudentId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_EducationGroupsStreams_EducationGroupId",
|
|
||||||
table: "EducationGroupsStreams",
|
|
||||||
column: "EducationGroupId");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_EducationGroupsDocuments_EducationGroupId",
|
|
||||||
table: "EducationGroupsDocuments",
|
|
||||||
column: "EducationGroupId");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Documents_User_UserId",
|
|
||||||
table: "Documents",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,497 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
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("20230518002727_nullableEdStatusId5")]
|
|
||||||
partial class nullableEdStatusId5
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
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<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Hours")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<bool>("MarkType")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Discipline");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Document", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("Date")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Documents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("NumberOfStudent")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroups");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("EducationGroupId", "DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("EducationGroupId", "StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationStatus", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationStatuses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Course")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Streams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfBirth")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int?>("EducationStatusId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StudentCard")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Surname")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("EducationStatusId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Students");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("StudentId", "DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.ToTable("StudentDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("StudentId", "StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("StudentStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Login")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Password")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("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("Disciplines")
|
|
||||||
.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("Documents")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("EducationGroups")
|
|
||||||
.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("EducationStatuses")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("Streams")
|
|
||||||
.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");
|
|
||||||
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("Students")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.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");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Disciplines");
|
|
||||||
|
|
||||||
b.Navigation("Documents");
|
|
||||||
|
|
||||||
b.Navigation("EducationGroups");
|
|
||||||
|
|
||||||
b.Navigation("EducationStatuses");
|
|
||||||
|
|
||||||
b.Navigation("Streams");
|
|
||||||
|
|
||||||
b.Navigation("Students");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,64 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace UniversityDataBaseImplemet.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class nullableEdStatusId5 : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_EducationStatuses_User_UserId",
|
|
||||||
table: "EducationStatuses");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Students_User_UserId",
|
|
||||||
table: "Students");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_EducationStatuses_User_UserId",
|
|
||||||
table: "EducationStatuses",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Students_User_UserId",
|
|
||||||
table: "Students",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_EducationStatuses_User_UserId",
|
|
||||||
table: "EducationStatuses");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Students_User_UserId",
|
|
||||||
table: "Students");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_EducationStatuses_User_UserId",
|
|
||||||
table: "EducationStatuses",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Students_User_UserId",
|
|
||||||
table: "Students",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,485 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
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("20230518085846_fix")]
|
|
||||||
partial class fix
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
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<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Hours")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<bool>("MarkType")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Discipline");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Document", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("Date")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Documents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("NumberOfStudent")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroups");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("EducationGroupId", "DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("EducationGroupId", "StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationStatus", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationStatuses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Course")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Streams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfBirth")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int?>("EducationStatusId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StudentCard")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Surname")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("EducationStatusId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Students");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("StudentId", "DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.ToTable("StudentDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("StudentId", "StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("StudentStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Login")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Password")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("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("Disciplines")
|
|
||||||
.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("Documents")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("EducationGroups")
|
|
||||||
.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("EducationStatuses")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("Streams")
|
|
||||||
.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");
|
|
||||||
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("Students")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.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");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Disciplines");
|
|
||||||
|
|
||||||
b.Navigation("Documents");
|
|
||||||
|
|
||||||
b.Navigation("EducationGroups");
|
|
||||||
|
|
||||||
b.Navigation("EducationStatuses");
|
|
||||||
|
|
||||||
b.Navigation("Streams");
|
|
||||||
|
|
||||||
b.Navigation("Students");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,62 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace UniversityDataBaseImplemet.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class fix : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "Id",
|
|
||||||
table: "StudentStreams");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "Id",
|
|
||||||
table: "StudentDocuments");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "Id",
|
|
||||||
table: "EducationGroupsStreams");
|
|
||||||
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "Id",
|
|
||||||
table: "EducationGroupsDocuments");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "Id",
|
|
||||||
table: "StudentStreams",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "Id",
|
|
||||||
table: "StudentDocuments",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "Id",
|
|
||||||
table: "EducationGroupsStreams",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
|
|
||||||
migrationBuilder.AddColumn<int>(
|
|
||||||
name: "Id",
|
|
||||||
table: "EducationGroupsDocuments",
|
|
||||||
type: "integer",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,488 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
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("20230518162032_fix2")]
|
|
||||||
partial class fix2
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
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<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Hours")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<bool>("MarkType")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Discipline");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Document", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("Date")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Documents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("NumberOfStudent")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroups");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("EducationGroupId", "DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("EducationGroupId", "StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationStatus", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationStatuses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Course")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Streams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfAddmission")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfBirth")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int?>("EducationStatusId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StudentCard")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Surname")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("EducationStatusId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Students");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("StudentId", "DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.ToTable("StudentDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("StudentId", "StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("StudentStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Login")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Password")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("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("Disciplines")
|
|
||||||
.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("Documents")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("EducationGroups")
|
|
||||||
.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("EducationStatuses")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("Streams")
|
|
||||||
.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");
|
|
||||||
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("Students")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.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");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Disciplines");
|
|
||||||
|
|
||||||
b.Navigation("Documents");
|
|
||||||
|
|
||||||
b.Navigation("EducationGroups");
|
|
||||||
|
|
||||||
b.Navigation("EducationStatuses");
|
|
||||||
|
|
||||||
b.Navigation("Streams");
|
|
||||||
|
|
||||||
b.Navigation("Students");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
using System;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace UniversityDataBaseImplemet.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class fix2 : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<DateTime>(
|
|
||||||
name: "DateOfAddmission",
|
|
||||||
table: "Students",
|
|
||||||
type: "timestamp with time zone",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "DateOfAddmission",
|
|
||||||
table: "Students");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,525 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
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("20230519152931_fixCustomerStream")]
|
|
||||||
partial class fixCustomerStream
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
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("UniversityContracts.ViewModels.EducationGroupViewModel", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("NumberOfStudent")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int?>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupViewModel");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Discipline", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Hours")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<bool>("MarkType")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Discipline");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Document", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("Date")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Documents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("NumberOfStudent")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroups");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("EducationGroupId", "DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("EducationGroupId", "StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationStatus", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationStatuses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Course")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Streams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfAddmission")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfBirth")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int?>("EducationStatusId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StudentCard")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Surname")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("EducationStatusId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Students");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("StudentId", "DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.ToTable("StudentDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("StudentId", "StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("StudentStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Login")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Password")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("Role")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityContracts.ViewModels.EducationGroupViewModel", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.Stream", null)
|
|
||||||
.WithMany("StreamEdGroups")
|
|
||||||
.HasForeignKey("StreamId");
|
|
||||||
});
|
|
||||||
|
|
||||||
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("Disciplines")
|
|
||||||
.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("Documents")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("EducationGroups")
|
|
||||||
.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("EducationStatuses")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("Streams")
|
|
||||||
.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");
|
|
||||||
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("Students")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.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("StreamEdGroups");
|
|
||||||
|
|
||||||
b.Navigation("StreamStudents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("DocumentStudents");
|
|
||||||
|
|
||||||
b.Navigation("StudentStream");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Disciplines");
|
|
||||||
|
|
||||||
b.Navigation("Documents");
|
|
||||||
|
|
||||||
b.Navigation("EducationGroups");
|
|
||||||
|
|
||||||
b.Navigation("EducationStatuses");
|
|
||||||
|
|
||||||
b.Navigation("Streams");
|
|
||||||
|
|
||||||
b.Navigation("Students");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace UniversityDataBaseImplemet.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class fixCustomerStream : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "EducationGroupViewModel",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "integer", nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
Name = table.Column<string>(type: "text", nullable: false),
|
|
||||||
NumberOfStudent = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
UserId = table.Column<int>(type: "integer", nullable: false),
|
|
||||||
StreamId = table.Column<int>(type: "integer", nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_EducationGroupViewModel", x => x.Id);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "FK_EducationGroupViewModel_Streams_StreamId",
|
|
||||||
column: x => x.StreamId,
|
|
||||||
principalTable: "Streams",
|
|
||||||
principalColumn: "Id");
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "IX_EducationGroupViewModel_StreamId",
|
|
||||||
table: "EducationGroupViewModel",
|
|
||||||
column: "StreamId");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "EducationGroupViewModel");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,525 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
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("20230519161234_fixCustomerStream2")]
|
|
||||||
partial class fixCustomerStream2
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
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("UniversityContracts.ViewModels.EducationGroupViewModel", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("NumberOfStudent")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int?>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupViewModel");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Discipline", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Hours")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<bool>("MarkType")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Discipline");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Document", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("Date")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Documents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("NumberOfStudent")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroups");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("EducationGroupId", "DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroupStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("EducationGroupId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("EducationGroupId", "StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("EducationGroupsStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationStatus", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("EducationStatuses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("Course")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Streams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfAddmission")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateOfBirth")
|
|
||||||
.HasColumnType("timestamp with time zone");
|
|
||||||
|
|
||||||
b.Property<int?>("EducationStatusId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("StudentCard")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Surname")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("UserId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.HasIndex("EducationStatusId");
|
|
||||||
|
|
||||||
b.HasIndex("UserId");
|
|
||||||
|
|
||||||
b.ToTable("Students");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentDocument", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("DocumentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("StudentId", "DocumentId");
|
|
||||||
|
|
||||||
b.HasIndex("DocumentId");
|
|
||||||
|
|
||||||
b.ToTable("StudentDocuments");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.StudentStream", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("StudentId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("StreamId")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("StudentId", "StreamId");
|
|
||||||
|
|
||||||
b.HasIndex("StreamId");
|
|
||||||
|
|
||||||
b.ToTable("StudentStreams");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Property<int>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<string>("Login")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Password")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("Role")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
|
||||||
|
|
||||||
b.ToTable("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityContracts.ViewModels.EducationGroupViewModel", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.Stream", null)
|
|
||||||
.WithMany("StreamEdGroups")
|
|
||||||
.HasForeignKey("StreamId");
|
|
||||||
});
|
|
||||||
|
|
||||||
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("Disciplines")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("Stream");
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Document", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("Documents")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.EducationGroup", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("EducationGroups")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.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("EducationStatuses")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Stream", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("Streams")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Navigation("User");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.EducationStatus", "EducationStatus")
|
|
||||||
.WithMany("Students")
|
|
||||||
.HasForeignKey("EducationStatusId");
|
|
||||||
|
|
||||||
b.HasOne("UniversityDataBaseImplemet.Models.User", "User")
|
|
||||||
.WithMany("Students")
|
|
||||||
.HasForeignKey("UserId")
|
|
||||||
.OnDelete(DeleteBehavior.NoAction)
|
|
||||||
.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("StreamEdGroups");
|
|
||||||
|
|
||||||
b.Navigation("StreamStudents");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.Student", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("DocumentStudents");
|
|
||||||
|
|
||||||
b.Navigation("StudentStream");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("UniversityDataBaseImplemet.Models.User", b =>
|
|
||||||
{
|
|
||||||
b.Navigation("Disciplines");
|
|
||||||
|
|
||||||
b.Navigation("Documents");
|
|
||||||
|
|
||||||
b.Navigation("EducationGroups");
|
|
||||||
|
|
||||||
b.Navigation("EducationStatuses");
|
|
||||||
|
|
||||||
b.Navigation("Streams");
|
|
||||||
|
|
||||||
b.Navigation("Students");
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,87 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
namespace UniversityDataBaseImplemet.Migrations
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public partial class fixCustomerStream2 : Migration
|
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Discipline_User_UserId",
|
|
||||||
table: "Discipline");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_EducationGroups_User_UserId",
|
|
||||||
table: "EducationGroups");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Streams_User_UserId",
|
|
||||||
table: "Streams");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Discipline_User_UserId",
|
|
||||||
table: "Discipline",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_EducationGroups_User_UserId",
|
|
||||||
table: "EducationGroups",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Streams_User_UserId",
|
|
||||||
table: "Streams",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Discipline_User_UserId",
|
|
||||||
table: "Discipline");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_EducationGroups_User_UserId",
|
|
||||||
table: "EducationGroups");
|
|
||||||
|
|
||||||
migrationBuilder.DropForeignKey(
|
|
||||||
name: "FK_Streams_User_UserId",
|
|
||||||
table: "Streams");
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Discipline_User_UserId",
|
|
||||||
table: "Discipline",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_EducationGroups_User_UserId",
|
|
||||||
table: "EducationGroups",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
|
|
||||||
migrationBuilder.AddForeignKey(
|
|
||||||
name: "FK_Streams_User_UserId",
|
|
||||||
table: "Streams",
|
|
||||||
column: "UserId",
|
|
||||||
principalTable: "User",
|
|
||||||
principalColumn: "Id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -124,7 +124,7 @@ namespace UniversityProvider.Controllers
|
|||||||
($"api/educationstatus/getmany?userId={APIClient.User.Id}&page={page}");
|
($"api/educationstatus/getmany?userId={APIClient.User.Id}&page={page}");
|
||||||
ViewBag.Page = page;
|
ViewBag.Page = page;
|
||||||
ViewBag.NumberOfPages = APIClient.GetRequest<int>
|
ViewBag.NumberOfPages = APIClient.GetRequest<int>
|
||||||
($"api/student/getnumberofpages?userId={APIClient.User.Id}");
|
($"api/educationstatus/getnumberofpages?userId={APIClient.User.Id}");
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,6 +199,12 @@ namespace UniversityProvider.Controllers
|
|||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IActionResult Exit()
|
||||||
|
{
|
||||||
|
APIClient.User = null;
|
||||||
|
return RedirectToAction("Login");
|
||||||
|
}
|
||||||
|
|
||||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||||
public IActionResult Error()
|
public IActionResult Error()
|
||||||
{
|
{
|
||||||
|
@ -3,22 +3,26 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@{
|
@{
|
||||||
<h4 id="document-data" class="fw-bold" data-id="@ViewBag.Document.Id">Привязка группы к приказу</h4>
|
<div class="text-center">
|
||||||
|
<h1 class="display-4" id="document-data" data-id="@ViewBag.Document.Id">
|
||||||
|
Привязка группы к приказу
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="error-div-shell" class="error-div-shell mb-2">
|
<div id="error-div-shell" class="error-div-shell mb-2">
|
||||||
<div>
|
<div>
|
||||||
<p id="error-p" class="error-p"></p>
|
<p id="error-p" class="error-p text-danger"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="mb-0">Название:</p>
|
<p class="mb-0">Название:</p>
|
||||||
<input type="text" readonly value="@ViewBag.Document.Name" id="name-input" name="name" class="form-control mb-3" />
|
<input type="text" readonly value="@ViewBag.Document.Name" id="name-input" name="name" class="form-control mb-3" />
|
||||||
|
|
||||||
<button id="create-button" type="button" class="button-primary text-button">
|
<button id="create-button" type="button" class="btn btn-primary text-button">
|
||||||
Сохранить привязку
|
Сохранить привязку
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div>
|
<div class="mt-4">
|
||||||
<div class="scrollable-table">
|
<div class="scrollable-table">
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
|
@ -2,22 +2,24 @@
|
|||||||
ViewData["Title"] = "Приказ";
|
ViewData["Title"] = "Приказ";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h4 class="fw-bold">Создание приказа</h4>
|
<div class="text-center">
|
||||||
|
<h1 class="display-4">Создание приказа</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="error-div-shell" class="error-div-shell mb-2">
|
<div id="error-div-shell" class="error-div-shell mb-2">
|
||||||
<div>
|
<div>
|
||||||
<p id="error-p" class="error-p"></p>
|
<p id="error-p" class="error-p text-danger"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="mb-0">Название:</p>
|
<p class="mb-0">Название:</p>
|
||||||
<input type="text" id="name-input" name="name" class="form-control mb-3" />
|
<input type="text" id="name-input" name="name" class="form-control mb-3" />
|
||||||
|
|
||||||
<button id="create-button" type="button" class="button-primary text-button">
|
<button id="create-button" type="button" class="btn btn-primary text-button">
|
||||||
Создать
|
Создать
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div>
|
<div class="mt-4">
|
||||||
<div class="scrollable-table">
|
<div class="scrollable-table">
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
|
@ -3,22 +3,24 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@{
|
@{
|
||||||
<h4 id="document-data" class="fw-bold" data-id="@ViewBag.Document.Id">Обновление приказа</h4>
|
<div class="text-center" id="document-data" data-id="@ViewBag.Document.Id">
|
||||||
|
<h1 class="display-4">Обновление приказа</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="error-div-shell" class="error-div-shell mb-2">
|
<div id="error-div-shell" class="error-div-shell mb-2">
|
||||||
<div>
|
<div>
|
||||||
<p id="error-p" class="error-p"></p>
|
<p id="error-p" class="error-p text-danger"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="mb-0">Название:</p>
|
<p class="mb-0">Название:</p>
|
||||||
<input type="text" value="@ViewBag.Document.Name" id="name-input" name="name" class="form-control mb-3" />
|
<input type="text" value="@ViewBag.Document.Name" id="name-input" name="name" class="form-control mb-3" />
|
||||||
|
|
||||||
<button id="create-button" type="button" class="button-primary text-button">
|
<button id="create-button" type="button" class="btn btn-primary text-button">
|
||||||
Сохранить изменения
|
Сохранить изменения
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div>
|
<div class="mt-4">
|
||||||
<div class="scrollable-table">
|
<div class="scrollable-table">
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
|
@ -5,7 +5,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@{
|
@{
|
||||||
<h4 class="fw-bold" id="vb-id">Назначение статуса обучения студенту</h4>
|
<div class="text-center">
|
||||||
|
<h1 class="display-4">Назначение статуса обучения</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
if (ViewBag.EducationStatusId == null)
|
if (ViewBag.EducationStatusId == null)
|
||||||
{
|
{
|
||||||
@ -13,23 +15,28 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="row">
|
<div id="error-div-shell" class="error-div-shell mb-2">
|
||||||
<div class="col-md-6">
|
<div>
|
||||||
|
<p id="error-p" class="error-p text-danger"></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mt-4">
|
||||||
|
<div class="col-md-6 form-group">
|
||||||
<label id="educationStatusLabel" data-id="@ViewBag.EducationStatusId" for="educationStatusInput">Статус обучения:</label>
|
<label id="educationStatusLabel" data-id="@ViewBag.EducationStatusId" for="educationStatusInput">Статус обучения:</label>
|
||||||
<input type="text" id="educationStatusInput" readonly value="" />
|
<input type="text" id="educationStatusInput" readonly value="" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row mt-4">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6 form-group">
|
||||||
<label for="studentsSelect">Студенты:</label>
|
<label for="studentsSelect">Студенты:</label>
|
||||||
<select id="studentsSelect">
|
<select id="studentsSelect">
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button id="update-button" type="button" class="button-primary text-button">
|
<button id="update-button" type="button" class="btn btn-primary mt-4">
|
||||||
Сохранить изменения
|
Сохранить изменения
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
@ -2,18 +2,20 @@
|
|||||||
ViewData["Title"] = "Статус обучения";
|
ViewData["Title"] = "Статус обучения";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h4 class="fw-bold">Добавление статуса обучения</h4>
|
<div class="text-center">
|
||||||
|
<h1 class="display-4">Добавление статуса обучения</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="error-div-shell" class="error-div-shell mb-2">
|
<div id="error-div-shell" class="error-div-shell mb-2">
|
||||||
<div>
|
<div>
|
||||||
<p id="error-p" class="error-p"></p>
|
<p id="error-p" class="error-p text-danger"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="mb-0">Название:</p>
|
<p class="mb-0">Название:</p>
|
||||||
<input type="text" id="name-input" name="name" class="form-control mb-3" />
|
<input type="text" id="name-input" name="name" class="form-control mb-3" />
|
||||||
|
|
||||||
<button id="create-button" type="button" class="button-primary text-button">
|
<button id="create-button" type="button" class="btn btn-primary">
|
||||||
Создать
|
Создать
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@{
|
@{
|
||||||
|
<div class="text-center">
|
||||||
<h4 class="fw-bold" id="vb-id" data-id="@ViewBag.EducationStatus.Id">Изменение данных статуса обучения</h4>
|
<h1 class="display-4" id="vb-id" data-id="@ViewBag.EducationStatus.Id">Изменение данных статуса обучения</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
if (ViewBag.EducationStatus == null)
|
if (ViewBag.EducationStatus == null)
|
||||||
{
|
{
|
||||||
@ -14,15 +15,15 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
<div id="error-div-shell" class="error-div-shell mb-2">
|
<div id="error-div-shell" class="error-div-shell mb-2">
|
||||||
<div>
|
<div>
|
||||||
<p id="error-p" class="error-p"></p>
|
<p id="error-p" class="error-p text-danger"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="mb-0">Название:</p>
|
<p class="mb-0">Название:</p>
|
||||||
<input value="@ViewBag.EducationStatus.Name" type="text" id="name-input" name="name" class="form-control mb-3" />
|
<input value="@ViewBag.EducationStatus.Name" type="text" id="name-input" name="name" class="form-control mb-3" />
|
||||||
|
|
||||||
<button id="update-button" type="button" class="button-primary text-button">
|
<button id="update-button" type="button" class="btn btn-primary text-button mt-4">
|
||||||
Сохранить изменения
|
Сохранить изменения
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,15 @@
|
|||||||
<button id="btnFlow">Статистика по потокам</button>
|
|
||||||
<button id="btnStatus">Статистика по статусам обучения</button>
|
<div class="text-center">
|
||||||
<div>
|
<h1 class="display-4">Круговая диаграмма</h1>
|
||||||
<canvas id="myChart"></canvas>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<button class="btn btn-success mt-4" id="btnStatus">Статистика по статусам обучения</button>
|
||||||
|
<div class="container col-8 mt-4">
|
||||||
|
<canvas id="myChart"></canvas>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||||
<script src="~/js/diagram/diagram.js" asp-append-version="true"></script>
|
<script src="~/js/diagram/diagram.js" asp-append-version="true"></script>
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
ViewData["Title"] = "Список дисциплин по студентам";
|
ViewData["Title"] = "Список дисциплин по студентам";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h4 class="fw-bold">Список дисциплин по студентам</h4>
|
<div class="text-center">
|
||||||
|
<h1 class="display-4">Список дисциплин по студентам</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="error-div-shell" class="error-div-shell mb-2">
|
<div id="error-div-shell" class="error-div-shell mb-2">
|
||||||
<div>
|
<div>
|
||||||
@ -10,20 +12,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<select id="file-type">
|
<div class="row justify-content-between">
|
||||||
<option>docx</option>
|
<select class="form-select" id="file-type">
|
||||||
<option>xlsx</option>
|
<option>docx</option>
|
||||||
</select>
|
<option>xlsx</option>
|
||||||
|
</select>
|
||||||
|
|
||||||
<button id="create-button" type="button" class="button-primary text-button">
|
<button id="create-button" type="button" class="btn btn-primary mt-4">
|
||||||
Показать итоговый вариант
|
Получить список по выбранным записям
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<button id="save-button" type="button" class="button-primary text-button">
|
<div class="mt-4">
|
||||||
Сохранить результат
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<div class="scrollable-table">
|
<div class="scrollable-table">
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
|
@ -17,14 +17,14 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
<div>
|
<div>
|
||||||
<a class="btn btn-secondary" asp-controller="Document" asp-action="Create">Создать приказ</a>
|
<a class="btn btn-success" asp-controller="Document" asp-action="Create">Создать приказ</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex mb-2 gap-1">
|
<div class="d-flex mb-2 gap-1">
|
||||||
<div class="input-group" style="width: auto;">
|
<div class="input-group" style="width: auto;">
|
||||||
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
|
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
|
||||||
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
|
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
|
||||||
</div>
|
</div>
|
||||||
<a href="/Home/EducationStatuses?page=@ViewBag.Page" id="go-button" class="button-primary text-button">
|
<a href="/Home/EducationStatuses?page=@ViewBag.Page" id="go-button" class="btn btn-info">
|
||||||
Перейти
|
Перейти
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -56,13 +56,13 @@
|
|||||||
@item.Date.ToString("yyyy-MM-dd")
|
@item.Date.ToString("yyyy-MM-dd")
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a id="update-button-@item.Id" class="btn btn-secondary" asp-controller="Document" asp-action="Bind" asp-route-id="@item.Id">Привязка</a>
|
<a id="update-button-@item.Id" class="btn btn-warning" asp-controller="Document" asp-action="Bind" asp-route-id="@item.Id">Привязка</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a id="update-button-@item.Id" class="btn btn-secondary" asp-controller="Document" asp-action="Update" asp-route-id="@item.Id">Изменить</a>
|
<a id="update-button-@item.Id" class="btn btn-primary" asp-controller="Document" asp-action="Update" asp-route-id="@item.Id">Изменить</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a id="remove-button-@item.Id" class="btn btn-secondary remove-btn" data-id="@item.Id">Удалить</a>
|
<a id="remove-button-@item.Id" class="btn btn-danger remove-btn" data-id="@item.Id">Удалить</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
@ -17,14 +17,14 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
<div>
|
<div>
|
||||||
<a class="btn btn-secondary" asp-controller="EducationStatus" asp-action="Create">Создать статус обучения</a>
|
<a class="btn btn-success" asp-controller="EducationStatus" asp-action="Create">Создать статус обучения</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex mb-2 gap-1">
|
<div class="d-flex mb-2 gap-1">
|
||||||
<div class="input-group" style="width: auto;">
|
<div class="input-group" style="width: auto;">
|
||||||
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
|
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
|
||||||
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
|
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
|
||||||
</div>
|
</div>
|
||||||
<a href="/Home/EducationStatuses?page=@ViewBag.Page" id="go-button" class="button-primary text-button">
|
<a href="/Home/EducationStatuses?page=@ViewBag.Page" id="go-button" class="btn btn-info">
|
||||||
Перейти
|
Перейти
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -53,13 +53,13 @@
|
|||||||
@item.Name
|
@item.Name
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a id="add-student-button-@item.Id" class="btn btn-secondary" asp-controller="EducationStatus" asp-action="AddStudent" asp-route-id="@item.Id">Назначить статус для студента</a>
|
<a id="add-student-button-@item.Id" class="btn btn-warning" asp-controller="EducationStatus" asp-action="AddStudent" asp-route-id="@item.Id">Назначить статус для студента</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a id="update-button-@item.Id" class="btn btn-secondary" asp-controller="EducationStatus" asp-action="Update" asp-route-id="@item.Id">Изменить</a>
|
<a id="update-button-@item.Id" class="btn btn-primary" asp-controller="EducationStatus" asp-action="Update" asp-route-id="@item.Id">Изменить</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a id="remove-button-@item.Id" class="btn btn-secondary remove-btn" data-id="@item.Id">Удалить</a>
|
<a id="remove-button-@item.Id" class="btn btn-danger remove-btn" data-id="@item.Id">Удалить</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Список дисциплин по студентам";
|
ViewData["Title"] = "Отчет";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h4 class="fw-bold">Список дисциплин по студентам</h4>
|
<div class="text-center">
|
||||||
|
<h1 class="display-4">Отчет по статусам обучения</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="error-div-shell" class="error-div-shell mb-2">
|
<div id="error-div-shell" class="error-div-shell mb-2">
|
||||||
<div>
|
<div>
|
||||||
@ -19,10 +21,10 @@
|
|||||||
<p class="mb-0">Дата конца:</p>
|
<p class="mb-0">Дата конца:</p>
|
||||||
<input id="date-to-input" class="form-control" type="date" />
|
<input id="date-to-input" class="form-control" type="date" />
|
||||||
</div>
|
</div>
|
||||||
<button id="generate-button" class="button-primary text-button mb-2">
|
<button id="generate-button" class="btn btn-primary mb-2">
|
||||||
Показать
|
Показать
|
||||||
</button>
|
</button>
|
||||||
<button id="send-by-mail-button" class="button-primary text-button mb-2">
|
<button id="send-by-mail-button" class="btn btn-primary mb-2">
|
||||||
На почту
|
На почту
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,26 +2,45 @@
|
|||||||
ViewData["Title"] = "Вход";
|
ViewData["Title"] = "Вход";
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="text-center">
|
<div class="container">
|
||||||
<h2 class="display-4">Вход в приложение</h2>
|
<div class="row justify-content-center align-items-center vh-100">
|
||||||
|
<div class="col-8">
|
||||||
|
<div class="text-center">
|
||||||
|
<h2 class="display-4">Вход в приложение</h2>
|
||||||
|
</div>
|
||||||
|
<div id="error-div-shell" class="error-div-shell mb-2">
|
||||||
|
<div>
|
||||||
|
<p id="error-p" class="error-p text-danger"></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<form id="form-login" method="post">
|
||||||
|
<div class="row form-group justify-content-center mt-4">
|
||||||
|
<div class="col-4 text-right">Логин:</div>
|
||||||
|
<div class="col-8">
|
||||||
|
<input type="email" name="login" class="form-control" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row form-group justify-content-center mt-4">
|
||||||
|
<div class="col-4 text-right">Пароль:</div>
|
||||||
|
<div class="col-8">
|
||||||
|
<input id="password-input" type="password" name="password" class="form-control" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row justify-content-between mt-4">
|
||||||
|
<div class="col-4">
|
||||||
|
<a class="text-white btn btn-primary" asp-area="" asp-controller="Home" asp-action="Registration">
|
||||||
|
Нет аккаунта?
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-4 text-right">
|
||||||
|
<button type="submit" class="btn btn-success">
|
||||||
|
Войти
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<form method="post">
|
|
||||||
<div class="row">
|
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||||
<div class="col-4">Логин:</div>
|
|
||||||
<div class="col-8"><input type="text" name="login" /></div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-4">Пароль:</div>
|
|
||||||
<div class="col-8"><input type="password" name="password" /></div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-8">
|
|
||||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Registration">
|
|
||||||
Нет аккаунта?
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div class="col-4">
|
|
||||||
<input type="submit" value="Войти" class="btn btn-primary" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
@ -2,11 +2,13 @@
|
|||||||
ViewData["Title"] = "Личные данные";
|
ViewData["Title"] = "Личные данные";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h4 class="fw-bold">Личные данные</h4>
|
<div class="text-center">
|
||||||
|
<h1 class="display-4">Личные данные</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="error-div-shell" class="error-div-shell">
|
<div id="error-div-shell" class="error-div-shell">
|
||||||
<div>
|
<div>
|
||||||
<p id="error-p" class="error-p mb-2"></p>
|
<p id="error-p" class="error-p text-danger mb-2"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -18,7 +20,7 @@
|
|||||||
<input id="password" name="password" type="password" class="form-control" value="@ViewBag.User.Password">
|
<input id="password" name="password" type="password" class="form-control" value="@ViewBag.User.Password">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button type="submit" id="update-button" class="button-primary text-button">
|
<button type="submit" id="update-button" class="btn btn-primary">
|
||||||
Обновить
|
Обновить
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,26 +2,39 @@
|
|||||||
ViewData["Title"] = "Регистрация";
|
ViewData["Title"] = "Регистрация";
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="text-center">
|
<div class="container">
|
||||||
<h2 class="display-4">Регистрация</h2>
|
<div class="row justify-content-center align-items-center vh-100">
|
||||||
|
<div class="col-8">
|
||||||
|
<div class="text-center">
|
||||||
|
<h2 class="display-4">Регистрация</h2>
|
||||||
|
</div>
|
||||||
|
<div id="error-div-shell" class="error-div-shell mb-2">
|
||||||
|
<div>
|
||||||
|
<p id="error-p" class="error-p text-danger"></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<form id="form-login" method="post">
|
||||||
|
<div class="row mt-4">
|
||||||
|
<div class="col-4 text-right">Логин (эл.почта):</div>
|
||||||
|
<div class="col-8"><input type="email" name="login" class="form-control" /></div>
|
||||||
|
</div>
|
||||||
|
<div class="row mt-4">
|
||||||
|
<div class="col-4 text-right">Пароль:</div>
|
||||||
|
<div class="col-8"><input type="password" name="password" class="form-control" /></div>
|
||||||
|
</div>
|
||||||
|
<div class="row mt-4">
|
||||||
|
<div class="col-8">
|
||||||
|
<a class="text-white btn btn-primary" asp-area="" asp-controller="Home" asp-action="Login">
|
||||||
|
Есть аккаунт?
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<input type="submit" value="Регистрация" class="btn btn-success" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<form method="post">
|
|
||||||
<div class="row">
|
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||||
<div class="col-4">Логин (эл.почта):</div>
|
|
||||||
<div class="col-8"><input type="email" name="login" /></div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-4">Пароль:</div>
|
|
||||||
<div class="col-8"><input type="password" name="password" /></div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-8">
|
|
||||||
<a class="nav-link text-primary" asp-area="" asp-controller="Home" asp-action="Login">
|
|
||||||
Есть аккаунт?
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div class="col-4">
|
|
||||||
<input type="submit" value="Регистрация" class="btn btn-primary" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
@ -17,14 +17,14 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
<div>
|
<div>
|
||||||
<a class="btn btn-secondary" asp-controller="Student" asp-action="Create">Добавить студента</a>
|
<a class="btn btn-success" asp-controller="Student" asp-action="Create">Добавить студента</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex mb-2 gap-1">
|
<div class="d-flex mb-2 gap-1">
|
||||||
<div class="input-group" style="width: auto;">
|
<div class="input-group" style="width: auto;">
|
||||||
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
|
<input id="page-input" type="number" min="1" value="@ViewBag.Page" max="@ViewBag.NumberOfPages" class="form-control" style="max-width: 5em">
|
||||||
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
|
<span class="input-group-text">/ @ViewBag.NumberOfPages</span>
|
||||||
</div>
|
</div>
|
||||||
<a href="/Home/Students?page=@ViewBag.Page" id="go-button" class="button-primary text-button">
|
<a href="/Home/Students?page=@ViewBag.Page" id="go-button" class="btn btn-info">
|
||||||
Перейти
|
Перейти
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@ -68,10 +68,10 @@
|
|||||||
@item.EducationStatusName
|
@item.EducationStatusName
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a id="update-button-@item.Id" class="btn btn-secondary" asp-controller="Student" asp-action="Update" asp-route-id="@item.Id">Изменить</a>
|
<a id="update-button-@item.Id" class="btn btn-primary" asp-controller="Student" asp-action="Update" asp-route-id="@item.Id">Изменить</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<a id="remove-button-@item.Id" class="btn btn-secondary remove-btn" data-id="@item.Id">Удалить</a>
|
<a id="remove-button-@item.Id" class="btn btn-danger remove-btn" data-id="@item.Id">Удалить</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
@ -7,46 +7,52 @@
|
|||||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
||||||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
||||||
<link rel="stylesheet" href="~/UniversityProvider.styles.css" asp-append-version="true" />
|
<link rel="stylesheet" href="~/UniversityProvider.styles.css" asp-append-version="true" />
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@if(APIClient.User != null)
|
@if(APIClient.User != null)
|
||||||
{
|
{
|
||||||
<header>
|
<header class="d-flex justify-content-center">
|
||||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
<nav class="navbar navbar-expand-lg navbar-toggleable-lg navbar-light bg-white border-bottom box-shadow mb-3">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">UniversityProvider</a>
|
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index"><img class="img-fluid header-logo" src="~/img/pngwing.com.png"></img></a>
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||||
aria-expanded="false" aria-label="Toggle navigation">
|
aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
|
<div id="navbarSupportedContent" class="collapse navbar-collapse d-sm-inline-flex justify-content-between">
|
||||||
<ul class="navbar-nav flex-grow-1">
|
<ul class="navbar-nav flex-grow-1 align-content-center">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Students">Студенты</a>
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Students">Студенты</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Documents">Приказы</a>
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Documents">Приказы</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="EducationStatuses">Статусы обучения</a>
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="EducationStatuses">Статусы обучения</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="DisciplineStudentList">Получить список</a>
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="DisciplineStudentList">Получить список</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="GetReport">Отчет</a>
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="GetReport">Отчет</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Diagram">График</a>
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Diagram">График</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
</ul>
|
||||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Profile">Профиль</a>
|
<ul class="navbar-nav flex-grow-1">
|
||||||
</li>
|
<li class="nav-item">
|
||||||
</ul>
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Profile"><i class="fas fa-user-circle"></i> Профиль</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="btn btn-danger" asp-area="" asp-controller="Home" asp-action="Exit"><i class="fas fa-sign-out-alt"></i> Выход</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</nav>
|
||||||
</nav>
|
</header>
|
||||||
</header>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
@ -56,7 +62,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
|
||||||
@await RenderSectionAsync("Scripts", required: false)
|
@await RenderSectionAsync("Scripts", required: false)
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -2,11 +2,13 @@
|
|||||||
ViewData["Title"] = "Студент";
|
ViewData["Title"] = "Студент";
|
||||||
}
|
}
|
||||||
|
|
||||||
<h4 class="fw-bold">Добавление студента</h4>
|
<div class="text-center">
|
||||||
|
<h1 class="display-4">Добавление студента</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="error-div-shell" class="error-div-shell mb-2">
|
<div id="error-div-shell" class="error-div-shell mb-2">
|
||||||
<div>
|
<div>
|
||||||
<p id="error-p" class="error-p"></p>
|
<p id="error-p" class="error-p text-danger"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -19,7 +21,7 @@
|
|||||||
<p class="mb-0">Номер студенческого билета:</p>
|
<p class="mb-0">Номер студенческого билета:</p>
|
||||||
<input type="text" id="studcard-input" name="studcard" class="form-control mb-3" />
|
<input type="text" id="studcard-input" name="studcard" class="form-control mb-3" />
|
||||||
|
|
||||||
<button id="create-button" type="button" class="button-primary text-button">
|
<button id="create-button" type="button" class="btn btn-primary text-button">
|
||||||
Создать
|
Создать
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
@ -5,8 +5,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@{
|
@{
|
||||||
|
<div class="text-center">
|
||||||
<h4 class="fw-bold" id="vb-id" data-id="@ViewBag.Student.Id">Изменение данных студента</h4>
|
<h1 class="display-4" id="vb-id" data-id="@ViewBag.Student.Id">Студенты</h1>
|
||||||
|
</div>
|
||||||
|
|
||||||
if (ViewBag.Student == null)
|
if (ViewBag.Student == null)
|
||||||
{
|
{
|
||||||
@ -15,7 +16,7 @@
|
|||||||
}
|
}
|
||||||
<div id="error-div-shell" class="error-div-shell mb-2">
|
<div id="error-div-shell" class="error-div-shell mb-2">
|
||||||
<div>
|
<div>
|
||||||
<p id="error-p" class="error-p"></p>
|
<p id="error-p" class="error-p text-danger"></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -28,7 +29,7 @@
|
|||||||
<p class="mb-0">Номер студенческого билета:</p>
|
<p class="mb-0">Номер студенческого билета:</p>
|
||||||
<input value="@ViewBag.Student.StudentCard" type="text" id="studcard-input" name="studcard" class="form-control mb-3" />
|
<input value="@ViewBag.Student.StudentCard" type="text" id="studcard-input" name="studcard" class="form-control mb-3" />
|
||||||
|
|
||||||
<button id="update-button" type="button" class="button-primary text-button">
|
<button id="update-button" type="button" class="btn btn-primary text-button">
|
||||||
Сохранить изменения
|
Сохранить изменения
|
||||||
</button>
|
</button>
|
||||||
}
|
}
|
||||||
|
@ -26,3 +26,6 @@ body {
|
|||||||
transition: background-color 0.3s ease;
|
transition: background-color 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.header-logo{
|
||||||
|
max-height: 100px;
|
||||||
|
}
|
BIN
UniversityProvider/wwwroot/img/pngwing.com.png
Normal file
BIN
UniversityProvider/wwwroot/img/pngwing.com.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 57 KiB |
@ -1,5 +1,4 @@
|
|||||||
var btnFlow = document.getElementById('btnFlow');
|
var btnStatus = document.getElementById('btnStatus');
|
||||||
var btnStatus = document.getElementById('btnStatus');
|
|
||||||
var educationStatusStats = [];
|
var educationStatusStats = [];
|
||||||
|
|
||||||
window.addEventListener('load', async () => {
|
window.addEventListener('load', async () => {
|
||||||
@ -13,41 +12,13 @@ window.addEventListener('load', async () => {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
var ctx = document.getElementById('myChart').getContext('2d');
|
var ctx = document.getElementById('myChart').getContext('2d');
|
||||||
var chart;
|
var chart;
|
||||||
|
|
||||||
function drawFlowChart() {
|
|
||||||
var flowData = {
|
|
||||||
labels: ['Поток 1', 'Поток 2', 'Поток 3'],
|
|
||||||
datasets: [{
|
|
||||||
label: 'Распределение студентов',
|
|
||||||
data: [80, 120, 100],
|
|
||||||
backgroundColor: ['#FF6384', '#36A2EB', '#FFCE56']
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
|
|
||||||
// Clear the previous chart if it exists
|
|
||||||
if (chart) {
|
|
||||||
chart.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
chart = new Chart(ctx, {
|
|
||||||
type: 'bar',
|
|
||||||
data: flowData,
|
|
||||||
options: {
|
|
||||||
responsive: true,
|
|
||||||
scales: {
|
|
||||||
y: {
|
|
||||||
beginAtZero: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function drawStatusChart() {
|
function drawStatusChart() {
|
||||||
var edStatus = [];
|
var edStatus = [];
|
||||||
var edCount = [];
|
var edCount = [];
|
||||||
|
console.log(educationStatusStats)
|
||||||
educationStatusStats.forEach((item) => {
|
educationStatusStats.forEach((item) => {
|
||||||
edStatus.push(item.name);
|
edStatus.push(item.name);
|
||||||
});
|
});
|
||||||
@ -75,11 +46,7 @@ function drawStatusChart() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
btnFlow.addEventListener('click', function () {
|
btnStatus.addEventListener('click', function () {
|
||||||
drawFlowChart();
|
drawStatusChart();
|
||||||
});
|
});
|
||||||
|
|
||||||
btnStatus.addEventListener('click', function () {
|
|
||||||
drawStatusChart();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@ const tbody = document.getElementById("scrollable-table__tbody")
|
|||||||
const nameInput = document.getElementById("name-input")
|
const nameInput = document.getElementById("name-input")
|
||||||
var students = []
|
var students = []
|
||||||
var dataArray = [];
|
var dataArray = [];
|
||||||
|
const errorP = document.getElementById("error-p");
|
||||||
|
const errorDivShell = document.getElementById("error-div-shell");
|
||||||
|
|
||||||
const correctData = () => {
|
const correctData = () => {
|
||||||
|
|
||||||
@ -10,7 +12,16 @@ const correctData = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const validate = () => {
|
const validate = () => {
|
||||||
|
if (nameInput.value === "") {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните поле 'Название'";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (dataArray.length === 0) {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните список 'Студенты'";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -5,6 +5,8 @@ const currentDocumentId = document.getElementById("document-data").dataset.id;
|
|||||||
var students = [];
|
var students = [];
|
||||||
var dataArray = [];
|
var dataArray = [];
|
||||||
var currentDocument = null;
|
var currentDocument = null;
|
||||||
|
const errorP = document.getElementById("error-p");
|
||||||
|
const errorDivShell = document.getElementById("error-div-shell");
|
||||||
|
|
||||||
const correctData = () => {
|
const correctData = () => {
|
||||||
|
|
||||||
@ -12,7 +14,16 @@ const correctData = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const validate = () => {
|
const validate = () => {
|
||||||
|
if (nameInput.value === "") {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните поле 'Название'";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (dataArray.length === 0) {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните список 'Студенты'";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3,6 +3,8 @@ const educationStatusId = document.getElementById("educationStatusLabel").datase
|
|||||||
const educationStatusInput = document.getElementById("educationStatusInput");
|
const educationStatusInput = document.getElementById("educationStatusInput");
|
||||||
const studentTable = document.getElementById("studentTable");
|
const studentTable = document.getElementById("studentTable");
|
||||||
const updateBtn = document.getElementById("update-button");
|
const updateBtn = document.getElementById("update-button");
|
||||||
|
const errorP = document.getElementById("error-p");
|
||||||
|
const errorDivShell = document.getElementById("error-div-shell");
|
||||||
|
|
||||||
var students = [];
|
var students = [];
|
||||||
var educationStatus = null;
|
var educationStatus = null;
|
||||||
@ -35,7 +37,9 @@ window.addEventListener("load", async () => {
|
|||||||
|
|
||||||
updateBtn.addEventListener("click", () => {
|
updateBtn.addEventListener("click", () => {
|
||||||
if (select.selectedIndex === -1) {
|
if (select.selectedIndex === -1) {
|
||||||
return;
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Выберите значение из списка";
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var student = students.find(x => x.id === parseInt(select.value));
|
var student = students.find(x => x.id === parseInt(select.value));
|
||||||
@ -98,12 +102,15 @@ select.addEventListener("change", () => {
|
|||||||
const tdArrowEducationStatusName = document.createElement('td');
|
const tdArrowEducationStatusName = document.createElement('td');
|
||||||
tdArrowEducationStatusName.innerHTML = "-->";
|
tdArrowEducationStatusName.innerHTML = "-->";
|
||||||
const tdEducationStatusName = createRow("", student.educationStatusName);
|
const tdEducationStatusName = createRow("", student.educationStatusName);
|
||||||
|
tdEducationStatusName.classList.add("text-decoration-line-through", "text-danger")
|
||||||
|
|
||||||
|
|
||||||
trEducationStatusName.appendChild(tdEducationStatusNameField);
|
trEducationStatusName.appendChild(tdEducationStatusNameField);
|
||||||
trEducationStatusName.appendChild(tdNewEducationStatusName);
|
trEducationStatusName.appendChild(tdNewEducationStatusName);
|
||||||
trEducationStatusName.appendChild(tdArrowEducationStatusName);
|
trEducationStatusName.appendChild(tdArrowEducationStatusName);
|
||||||
trEducationStatusName.appendChild(tdEducationStatusName);
|
trEducationStatusName.appendChild(tdEducationStatusName);
|
||||||
|
|
||||||
|
|
||||||
studentTable.append(
|
studentTable.append(
|
||||||
trName,
|
trName,
|
||||||
trSurname,
|
trSurname,
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
const createBtn = document.getElementById("create-button");
|
const createBtn = document.getElementById("create-button");
|
||||||
const nameInput = document.getElementById("name-input");
|
const nameInput = document.getElementById("name-input");
|
||||||
|
const errorP = document.getElementById("error-p");
|
||||||
|
const errorDivShell = document.getElementById("error-div-shell");
|
||||||
|
|
||||||
const correctData = () => {
|
const correctData = () => {
|
||||||
|
|
||||||
@ -7,7 +9,11 @@ const correctData = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const validate = () => {
|
const validate = () => {
|
||||||
|
if (nameInput.value === "") {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните поле 'Название'";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
const updateBtn = document.getElementById("update-button");
|
const updateBtn = document.getElementById("update-button");
|
||||||
const nameInput = document.getElementById("name-input")
|
const nameInput = document.getElementById("name-input")
|
||||||
const studId = document.getElementById("vb-id").dataset.id
|
const studId = document.getElementById("vb-id").dataset.id
|
||||||
|
const errorP = document.getElementById("error-p");
|
||||||
|
const errorDivShell = document.getElementById("error-div-shell");
|
||||||
|
|
||||||
const correctData = () => {
|
const correctData = () => {
|
||||||
|
|
||||||
@ -8,7 +10,11 @@ const correctData = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const validate = () => {
|
const validate = () => {
|
||||||
|
if (nameInput.value === "") {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните поле 'Название'";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
const updateBtn = document.getElementById("update-button");
|
|
||||||
const nameInput = document.getElementById("name-input")
|
|
||||||
const surnameInput = document.getElementById("surname-input")
|
|
||||||
const dateInput = document.getElementById("date-input")
|
|
||||||
const studCardInput = document.getElementById("studcard-input")
|
|
||||||
const studId = document.getElementById("vb-id").dataset.id
|
|
||||||
|
|
||||||
const correctData = () => {
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
const validate = () => {
|
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
|
||||||
|
|
||||||
updateBtn.addEventListener("click", () => {
|
|
||||||
if (!correctData()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!validate()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let student = {
|
|
||||||
"Id": parseInt(studId),
|
|
||||||
"Name": nameInput.value,
|
|
||||||
"Surname": surnameInput.value,
|
|
||||||
"DateOfBirth": new Date(dateInput.value),
|
|
||||||
"StudentCard": parseInt(studCardInput.value),
|
|
||||||
};
|
|
||||||
console.log(student)
|
|
||||||
$.ajax({
|
|
||||||
url: "/student/update",
|
|
||||||
type: "POST",
|
|
||||||
contentType: "application/json",
|
|
||||||
data: JSON.stringify(student)
|
|
||||||
}).done(() => {
|
|
||||||
window.location.href = "/Home/Students";
|
|
||||||
});
|
|
||||||
});
|
|
26
UniversityProvider/wwwroot/js/profile/profile.js
Normal file
26
UniversityProvider/wwwroot/js/profile/profile.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
const passwordInput = document.getElementById("password");
|
||||||
|
const form = document.getElementById("form");
|
||||||
|
const updateButton = document.getElementById("update-button");
|
||||||
|
const errorDivShell = document.getElementById("error-div-shell");
|
||||||
|
const errorP = document.getElementById("error-p");
|
||||||
|
|
||||||
|
updateButton.addEventListener("click", () => {
|
||||||
|
if (!validate()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
form.submit();
|
||||||
|
});
|
||||||
|
|
||||||
|
passwordInput.addEventListener("input", () => {
|
||||||
|
errorDivShell.style.gridTemplateRows = "0fr";
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const validate = function () {
|
||||||
|
if (passwordInput.value === "") {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните поле 'Пароль'";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
@ -85,21 +85,3 @@ const renderTable = (data) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const createTableSection = (streamName, students) => {
|
|
||||||
const tr = document.createElement('tr');
|
|
||||||
const trWrapper = [];
|
|
||||||
tr.classList.add("table-row");
|
|
||||||
tr.appendChild(createTableCell(streamName));
|
|
||||||
|
|
||||||
students.forEach((item) => {
|
|
||||||
const newTr = document.createElement('tr');
|
|
||||||
newTr.appendChild(createTableCell(item))
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const createTableCell = (item) => {
|
|
||||||
const td = document.createElement('td');
|
|
||||||
td.innerHTML = cellText;
|
|
||||||
return td;
|
|
||||||
}
|
|
@ -1,4 +1,11 @@
|
|||||||
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
|
const passwordInput = document.getElementById("password-input");
|
||||||
// for details on configuring this project to bundle and minify static web assets.
|
const errorP = document.getElementById("error-p");
|
||||||
|
const errorDivShell = document.getElementById("error-div-shell");
|
||||||
|
|
||||||
// Write your JavaScript code.
|
document.getElementById('form-login').addEventListener('submit', function (event) {
|
||||||
|
if (passwordInput.value.trim() === '') {
|
||||||
|
event.preventDefault();
|
||||||
|
var errorP = document.getElementById('error-p');
|
||||||
|
errorP.innerHTML = 'Пожалуйста, введите пароль';
|
||||||
|
}
|
||||||
|
});
|
@ -3,22 +3,59 @@ const nameInput = document.getElementById("name-input")
|
|||||||
const surnameInput = document.getElementById("surname-input")
|
const surnameInput = document.getElementById("surname-input")
|
||||||
const dateInput = document.getElementById("date-input")
|
const dateInput = document.getElementById("date-input")
|
||||||
const studCardInput = document.getElementById("studcard-input")
|
const studCardInput = document.getElementById("studcard-input")
|
||||||
|
const errorP = document.getElementById("error-p");
|
||||||
|
const errorDivShell = document.getElementById("error-div-shell");
|
||||||
|
students = []
|
||||||
|
|
||||||
|
window.addEventListener("load", () => {
|
||||||
|
const studentsResponse = $.ajax({
|
||||||
|
url: `/student/getallbyuser`,
|
||||||
|
type: "GET",
|
||||||
|
contentType: "json"
|
||||||
|
});
|
||||||
|
students = studentsResponse;
|
||||||
|
})
|
||||||
|
|
||||||
const correctData = () => {
|
const correctData = () => {
|
||||||
|
|
||||||
return true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const validate = () => {
|
const validate = () => {
|
||||||
|
var validStudentCard = true
|
||||||
|
if (nameInput.value === "") {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните поле 'Имя'";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (surnameInput.value === "") {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните поле 'Фамилия'";
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (dateInput.value === "") {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните поле 'Дата рождения'";
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
students.forEach((student) => {
|
||||||
|
if (student.studentCard === parseInt(studCardInput.value)) {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните поле 'Дата рождения'";
|
||||||
|
validStudentCard = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!validStudentCard) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
};
|
};
|
||||||
|
|
||||||
createBtn.addEventListener("click", () => {
|
createBtn.addEventListener("click", () => {
|
||||||
if (!correctData()) {
|
if (!validate()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!validate()) {
|
if (!correctData()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let student = {
|
let student = {
|
||||||
@ -28,7 +65,6 @@ createBtn.addEventListener("click", () => {
|
|||||||
"DateOfAddmission": new Date(),
|
"DateOfAddmission": new Date(),
|
||||||
"StudentCard": parseInt(studCardInput.value),
|
"StudentCard": parseInt(studCardInput.value),
|
||||||
};
|
};
|
||||||
console.log(student)
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/student/create",
|
url: "/student/create",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
@ -4,6 +4,19 @@ const surnameInput = document.getElementById("surname-input")
|
|||||||
const dateInput = document.getElementById("date-input")
|
const dateInput = document.getElementById("date-input")
|
||||||
const studCardInput = document.getElementById("studcard-input")
|
const studCardInput = document.getElementById("studcard-input")
|
||||||
const studId = document.getElementById("vb-id").dataset.id
|
const studId = document.getElementById("vb-id").dataset.id
|
||||||
|
const errorP = document.getElementById("error-p");
|
||||||
|
const errorDivShell = document.getElementById("error-div-shell");
|
||||||
|
|
||||||
|
students = []
|
||||||
|
|
||||||
|
window.addEventListener("load", () => {
|
||||||
|
const studentsResponse = $.ajax({
|
||||||
|
url: `/student/getallbyuser`,
|
||||||
|
type: "GET",
|
||||||
|
contentType: "json"
|
||||||
|
});
|
||||||
|
students = studentsResponse;
|
||||||
|
})
|
||||||
|
|
||||||
const correctData = () => {
|
const correctData = () => {
|
||||||
|
|
||||||
@ -11,8 +24,34 @@ const correctData = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const validate = () => {
|
const validate = () => {
|
||||||
|
var validStudentCard = true
|
||||||
|
if (nameInput.value === "") {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните поле 'Имя'";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (surnameInput.value === "") {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните поле 'Фамилия'";
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if (dateInput.value === "") {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните поле 'Дата рождения'";
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
students.forEach((student) => {
|
||||||
|
if (student.studentCard === parseInt(studCardInput.value)) {
|
||||||
|
errorDivShell.style.gridTemplateRows = "1fr";
|
||||||
|
errorP.innerHTML = "Заполните поле 'Дата рождения'";
|
||||||
|
validStudentCard = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!validStudentCard) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
};
|
};
|
||||||
|
|
||||||
updateBtn.addEventListener("click", () => {
|
updateBtn.addEventListener("click", () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user