PIbd-21_Pyatakov_KM_Markov_.../UniversityDataBaseImplemet/Migrations/20230516175336_fixRole.Designer.cs

505 lines
18 KiB
C#

// <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
}
}
}