бд готово

This commit is contained in:
GokaPek 2024-05-14 22:01:34 +04:00
parent 9f9e4e92f9
commit 3120058349
4 changed files with 932 additions and 1 deletions

View File

@ -0,0 +1,456 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using TaskTrackerDatabase;
#nullable disable
namespace TaskTrackerDatabase.Migrations
{
[DbContext(typeof(TaskTrackerDatabase))]
[Migration("20240514163125_PE")]
partial class PE
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.16")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("TaskTrackerDatabase.Models.Direction", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Directions");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.DirectionStudent", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("DirectionId")
.HasColumnType("int");
b.Property<int>("StudentId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("DirectionId");
b.HasIndex("StudentId");
b.ToTable("DirectionStudents");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.DirectionSubject", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("DirectionId")
.HasColumnType("int");
b.Property<int>("SubjectId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("DirectionId");
b.HasIndex("SubjectId");
b.ToTable("DirectionSubjects");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Exam", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("Date")
.HasColumnType("datetime2");
b.Property<int?>("StudentId")
.HasColumnType("int");
b.Property<int>("SubjectId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("StudentId");
b.HasIndex("SubjectId");
b.ToTable("Exams");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Organization", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("OrganizationName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Organizations");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.OrganizationProject", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("NumberEmployees")
.HasColumnType("int");
b.Property<int>("OrganizationId")
.HasColumnType("int");
b.Property<int>("ProjectId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("OrganizationId");
b.HasIndex("ProjectId");
b.ToTable("OrganizationProjects");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Project", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("ProjectName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Projects");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Result", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Grade")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("StudentId")
.HasColumnType("int");
b.Property<int>("SubjectId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("StudentId");
b.HasIndex("SubjectId");
b.ToTable("Results");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Student", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("DateBirth")
.HasColumnType("datetime2");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Students");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Subject", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Subjects");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Task", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("DateCreate")
.HasColumnType("datetime2");
b.Property<DateTime?>("DateImplement")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("ProjectId")
.HasColumnType("int");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ProjectId");
b.HasIndex("UserId");
b.ToTable("Tasks");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("UserFIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.DirectionStudent", b =>
{
b.HasOne("TaskTrackerDatabase.Models.Direction", "Direction")
.WithMany("Students")
.HasForeignKey("DirectionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TaskTrackerDatabase.Models.Student", "Student")
.WithMany()
.HasForeignKey("StudentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Direction");
b.Navigation("Student");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.DirectionSubject", b =>
{
b.HasOne("TaskTrackerDatabase.Models.Direction", "Direction")
.WithMany("Subjects")
.HasForeignKey("DirectionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TaskTrackerDatabase.Models.Subject", "Subject")
.WithMany()
.HasForeignKey("SubjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Direction");
b.Navigation("Subject");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Exam", b =>
{
b.HasOne("TaskTrackerDatabase.Models.Student", null)
.WithMany("Exams")
.HasForeignKey("StudentId");
b.HasOne("TaskTrackerDatabase.Models.Subject", "Subject")
.WithMany("Exams")
.HasForeignKey("SubjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Subject");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.OrganizationProject", b =>
{
b.HasOne("TaskTrackerDatabase.Models.Organization", "Organization")
.WithMany("Projects")
.HasForeignKey("OrganizationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TaskTrackerDatabase.Models.Project", "Project")
.WithMany("OrganizationProjects")
.HasForeignKey("ProjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Organization");
b.Navigation("Project");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Result", b =>
{
b.HasOne("TaskTrackerDatabase.Models.Student", "Student")
.WithMany("Results")
.HasForeignKey("StudentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TaskTrackerDatabase.Models.Subject", "Subject")
.WithMany("Results")
.HasForeignKey("SubjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Student");
b.Navigation("Subject");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Task", b =>
{
b.HasOne("TaskTrackerDatabase.Models.Project", "Project")
.WithMany("Tasks")
.HasForeignKey("ProjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TaskTrackerDatabase.Models.User", "User")
.WithMany("Tasks")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Project");
b.Navigation("User");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Direction", b =>
{
b.Navigation("Students");
b.Navigation("Subjects");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Organization", b =>
{
b.Navigation("Projects");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Project", b =>
{
b.Navigation("OrganizationProjects");
b.Navigation("Tasks");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Student", b =>
{
b.Navigation("Exams");
b.Navigation("Results");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Subject", b =>
{
b.Navigation("Exams");
b.Navigation("Results");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.User", b =>
{
b.Navigation("Tasks");
});
#pragma warning restore 612, 618
}
}
}

View File

@ -0,0 +1,225 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace TaskTrackerDatabase.Migrations
{
/// <inheritdoc />
public partial class PE : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Directions",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Directions", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Students",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
DateBirth = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Students", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Subjects",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Name = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Subjects", x => x.Id);
});
migrationBuilder.CreateTable(
name: "DirectionStudents",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DirectionId = table.Column<int>(type: "int", nullable: false),
StudentId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DirectionStudents", x => x.Id);
table.ForeignKey(
name: "FK_DirectionStudents_Directions_DirectionId",
column: x => x.DirectionId,
principalTable: "Directions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DirectionStudents_Students_StudentId",
column: x => x.StudentId,
principalTable: "Students",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "DirectionSubjects",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
DirectionId = table.Column<int>(type: "int", nullable: false),
SubjectId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DirectionSubjects", x => x.Id);
table.ForeignKey(
name: "FK_DirectionSubjects_Directions_DirectionId",
column: x => x.DirectionId,
principalTable: "Directions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DirectionSubjects_Subjects_SubjectId",
column: x => x.SubjectId,
principalTable: "Subjects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Exams",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
SubjectId = table.Column<int>(type: "int", nullable: false),
Date = table.Column<DateTime>(type: "datetime2", nullable: false),
StudentId = table.Column<int>(type: "int", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Exams", x => x.Id);
table.ForeignKey(
name: "FK_Exams_Students_StudentId",
column: x => x.StudentId,
principalTable: "Students",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Exams_Subjects_SubjectId",
column: x => x.SubjectId,
principalTable: "Subjects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Results",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
Grade = table.Column<string>(type: "nvarchar(max)", nullable: false),
StudentId = table.Column<int>(type: "int", nullable: false),
SubjectId = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Results", x => x.Id);
table.ForeignKey(
name: "FK_Results_Students_StudentId",
column: x => x.StudentId,
principalTable: "Students",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Results_Subjects_SubjectId",
column: x => x.SubjectId,
principalTable: "Subjects",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_DirectionStudents_DirectionId",
table: "DirectionStudents",
column: "DirectionId");
migrationBuilder.CreateIndex(
name: "IX_DirectionStudents_StudentId",
table: "DirectionStudents",
column: "StudentId");
migrationBuilder.CreateIndex(
name: "IX_DirectionSubjects_DirectionId",
table: "DirectionSubjects",
column: "DirectionId");
migrationBuilder.CreateIndex(
name: "IX_DirectionSubjects_SubjectId",
table: "DirectionSubjects",
column: "SubjectId");
migrationBuilder.CreateIndex(
name: "IX_Exams_StudentId",
table: "Exams",
column: "StudentId");
migrationBuilder.CreateIndex(
name: "IX_Exams_SubjectId",
table: "Exams",
column: "SubjectId");
migrationBuilder.CreateIndex(
name: "IX_Results_StudentId",
table: "Results",
column: "StudentId");
migrationBuilder.CreateIndex(
name: "IX_Results_SubjectId",
table: "Results",
column: "SubjectId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DirectionStudents");
migrationBuilder.DropTable(
name: "DirectionSubjects");
migrationBuilder.DropTable(
name: "Exams");
migrationBuilder.DropTable(
name: "Results");
migrationBuilder.DropTable(
name: "Directions");
migrationBuilder.DropTable(
name: "Students");
migrationBuilder.DropTable(
name: "Subjects");
}
}
}

View File

@ -22,6 +22,95 @@ namespace TaskTrackerDatabase.Migrations
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("TaskTrackerDatabase.Models.Direction", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Directions");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.DirectionStudent", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("DirectionId")
.HasColumnType("int");
b.Property<int>("StudentId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("DirectionId");
b.HasIndex("StudentId");
b.ToTable("DirectionStudents");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.DirectionSubject", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("DirectionId")
.HasColumnType("int");
b.Property<int>("SubjectId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("DirectionId");
b.HasIndex("SubjectId");
b.ToTable("DirectionSubjects");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Exam", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("Date")
.HasColumnType("datetime2");
b.Property<int?>("StudentId")
.HasColumnType("int");
b.Property<int>("SubjectId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("StudentId");
b.HasIndex("SubjectId");
b.ToTable("Exams");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Organization", b =>
{
b.Property<int>("Id")
@ -82,6 +171,70 @@ namespace TaskTrackerDatabase.Migrations
b.ToTable("Projects");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Result", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Grade")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("StudentId")
.HasColumnType("int");
b.Property<int>("SubjectId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("StudentId");
b.HasIndex("SubjectId");
b.ToTable("Results");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Student", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime>("DateBirth")
.HasColumnType("datetime2");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Students");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Subject", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Subjects");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Task", b =>
{
b.Property<int>("Id")
@ -147,6 +300,59 @@ namespace TaskTrackerDatabase.Migrations
b.ToTable("Users");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.DirectionStudent", b =>
{
b.HasOne("TaskTrackerDatabase.Models.Direction", "Direction")
.WithMany("Students")
.HasForeignKey("DirectionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TaskTrackerDatabase.Models.Student", "Student")
.WithMany()
.HasForeignKey("StudentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Direction");
b.Navigation("Student");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.DirectionSubject", b =>
{
b.HasOne("TaskTrackerDatabase.Models.Direction", "Direction")
.WithMany("Subjects")
.HasForeignKey("DirectionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TaskTrackerDatabase.Models.Subject", "Subject")
.WithMany()
.HasForeignKey("SubjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Direction");
b.Navigation("Subject");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Exam", b =>
{
b.HasOne("TaskTrackerDatabase.Models.Student", null)
.WithMany("Exams")
.HasForeignKey("StudentId");
b.HasOne("TaskTrackerDatabase.Models.Subject", "Subject")
.WithMany("Exams")
.HasForeignKey("SubjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Subject");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.OrganizationProject", b =>
{
b.HasOne("TaskTrackerDatabase.Models.Organization", "Organization")
@ -166,6 +372,25 @@ namespace TaskTrackerDatabase.Migrations
b.Navigation("Project");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Result", b =>
{
b.HasOne("TaskTrackerDatabase.Models.Student", "Student")
.WithMany("Results")
.HasForeignKey("StudentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("TaskTrackerDatabase.Models.Subject", "Subject")
.WithMany("Results")
.HasForeignKey("SubjectId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Student");
b.Navigation("Subject");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Task", b =>
{
b.HasOne("TaskTrackerDatabase.Models.Project", "Project")
@ -185,6 +410,13 @@ namespace TaskTrackerDatabase.Migrations
b.Navigation("User");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Direction", b =>
{
b.Navigation("Students");
b.Navigation("Subjects");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Organization", b =>
{
b.Navigation("Projects");
@ -197,6 +429,20 @@ namespace TaskTrackerDatabase.Migrations
b.Navigation("Tasks");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Student", b =>
{
b.Navigation("Exams");
b.Navigation("Results");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.Subject", b =>
{
b.Navigation("Exams");
b.Navigation("Results");
});
modelBuilder.Entity("TaskTrackerDatabase.Models.User", b =>
{
b.Navigation("Tasks");

View File

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
@ -7,6 +7,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.16">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>