This commit is contained in:
SpecialX
2025-06-27 19:03:10 +08:00
parent 14fbe6397a
commit a21ca80782
57 changed files with 3872 additions and 611 deletions

View File

@@ -1,95 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace TechHelper.Server.Migrations
{
/// <inheritdoc />
public partial class up : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_class_teachers_AspNetUsers_teacher_id",
table: "class_teachers");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("8b814a50-fd96-4bfa-a666-b247c0f13e22"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("ab2c8f8c-1ade-4ff5-9eb4-2925a89567b1"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("c6f92bbf-190f-47a5-b4d6-ed6874a378e8"));
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ new Guid("195b19c5-fd30-455c-9f38-9842b44bf5c3"), null, "Teacher", "TEACHER" },
{ new Guid("53cc63db-74bc-47a8-b71a-7e120d4018a9"), null, "Administrator", "ADMINISTRATOR" },
{ new Guid("a203eb76-97f0-418f-bc06-9549297d2ac3"), null, "Student", "STUDENT" }
});
migrationBuilder.AddForeignKey(
name: "FK_class_teachers_AspNetUsers_teacher_id",
table: "class_teachers",
column: "teacher_id",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_class_teachers_AspNetUsers_teacher_id",
table: "class_teachers");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("195b19c5-fd30-455c-9f38-9842b44bf5c3"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("53cc63db-74bc-47a8-b71a-7e120d4018a9"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("a203eb76-97f0-418f-bc06-9549297d2ac3"));
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ new Guid("8b814a50-fd96-4bfa-a666-b247c0f13e22"), null, "Administrator", "ADMINISTRATOR" },
{ new Guid("ab2c8f8c-1ade-4ff5-9eb4-2925a89567b1"), null, "Student", "STUDENT" },
{ new Guid("c6f92bbf-190f-47a5-b4d6-ed6874a378e8"), null, "Teacher", "TEACHER" }
});
migrationBuilder.AddForeignKey(
name: "FK_class_teachers_AspNetUsers_teacher_id",
table: "class_teachers",
column: "teacher_id",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}
}

View File

@@ -12,8 +12,8 @@ using TechHelper.Context;
namespace TechHelper.Server.Migrations
{
[DbContext(typeof(ApplicationContext))]
[Migration("20250625032845_up")]
partial class up
[Migration("20250626073834_init")]
partial class init
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -512,7 +512,6 @@ namespace TechHelper.Server.Migrations
.HasColumnName("deleted");
b.Property<string>("OverallFeedback")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("overall_feedback");
@@ -579,7 +578,6 @@ namespace TechHelper.Server.Migrations
.HasColumnName("points_awarded");
b.Property<string>("StudentAnswer")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("student_answer");
@@ -592,7 +590,6 @@ namespace TechHelper.Server.Migrations
.HasColumnName("submission_id");
b.Property<string>("TeacherFeedback")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("teacher_feedback");
@@ -747,19 +744,19 @@ namespace TechHelper.Server.Migrations
b.HasData(
new
{
Id = new Guid("a203eb76-97f0-418f-bc06-9549297d2ac3"),
Id = new Guid("3cfe35e8-73d5-4170-9856-f1d078554822"),
Name = "Student",
NormalizedName = "STUDENT"
},
new
{
Id = new Guid("195b19c5-fd30-455c-9f38-9842b44bf5c3"),
Id = new Guid("754c4967-6af2-4a81-b970-1e90a3a269b3"),
Name = "Teacher",
NormalizedName = "TEACHER"
},
new
{
Id = new Guid("53cc63db-74bc-47a8-b71a-7e120d4018a9"),
Id = new Guid("8546457c-185c-4b79-bece-bc21e41d02e7"),
Name = "Administrator",
NormalizedName = "ADMINISTRATOR"
});

View File

@@ -323,7 +323,7 @@ namespace TechHelper.Server.Migrations
column: x => x.teacher_id,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_class_teachers_classes_class_id",
column: x => x.class_id,
@@ -565,7 +565,7 @@ namespace TechHelper.Server.Migrations
attempt_number = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
submission_time = table.Column<DateTime>(type: "datetime(6)", nullable: false),
overall_grade = table.Column<float>(type: "float", precision: 5, scale: 2, nullable: true),
overall_feedback = table.Column<string>(type: "longtext", nullable: false)
overall_feedback = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
graded_by = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
graded_at = table.Column<DateTime>(type: "datetime(6)", nullable: true),
@@ -604,11 +604,11 @@ namespace TechHelper.Server.Migrations
submission_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
student_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
assignment_question_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
student_answer = table.Column<string>(type: "longtext", nullable: false)
student_answer = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
is_correct = table.Column<bool>(type: "tinyint(1)", nullable: true),
points_awarded = table.Column<float>(type: "float", precision: 5, scale: 2, nullable: true),
teacher_feedback = table.Column<string>(type: "longtext", nullable: false)
teacher_feedback = table.Column<string>(type: "longtext", nullable: true)
.Annotation("MySql:CharSet", "utf8mb4"),
created_at = table.Column<DateTime>(type: "datetime(6)", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
@@ -644,9 +644,9 @@ namespace TechHelper.Server.Migrations
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ new Guid("8b814a50-fd96-4bfa-a666-b247c0f13e22"), null, "Administrator", "ADMINISTRATOR" },
{ new Guid("ab2c8f8c-1ade-4ff5-9eb4-2925a89567b1"), null, "Student", "STUDENT" },
{ new Guid("c6f92bbf-190f-47a5-b4d6-ed6874a378e8"), null, "Teacher", "TEACHER" }
{ new Guid("3cfe35e8-73d5-4170-9856-f1d078554822"), null, "Student", "STUDENT" },
{ new Guid("754c4967-6af2-4a81-b970-1e90a3a269b3"), null, "Teacher", "TEACHER" },
{ new Guid("8546457c-185c-4b79-bece-bc21e41d02e7"), null, "Administrator", "ADMINISTRATOR" }
});
migrationBuilder.CreateIndex(

View File

@@ -12,8 +12,8 @@ using TechHelper.Context;
namespace TechHelper.Server.Migrations
{
[DbContext(typeof(ApplicationContext))]
[Migration("20250624103910_init")]
partial class init
[Migration("20250627101025_upd")]
partial class upd
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@@ -198,6 +198,11 @@ namespace TechHelper.Server.Migrations
.HasColumnType("float")
.HasColumnName("score");
b.Property<string>("Sequence")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("sequence");
b.Property<byte>("StructType")
.HasColumnType("tinyint unsigned")
.HasColumnName("group_state");
@@ -512,7 +517,6 @@ namespace TechHelper.Server.Migrations
.HasColumnName("deleted");
b.Property<string>("OverallFeedback")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("overall_feedback");
@@ -579,7 +583,6 @@ namespace TechHelper.Server.Migrations
.HasColumnName("points_awarded");
b.Property<string>("StudentAnswer")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("student_answer");
@@ -592,7 +595,6 @@ namespace TechHelper.Server.Migrations
.HasColumnName("submission_id");
b.Property<string>("TeacherFeedback")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("teacher_feedback");
@@ -747,19 +749,19 @@ namespace TechHelper.Server.Migrations
b.HasData(
new
{
Id = new Guid("ab2c8f8c-1ade-4ff5-9eb4-2925a89567b1"),
Id = new Guid("c310acf7-9605-4c55-8b9f-9bf9cd2dadb9"),
Name = "Student",
NormalizedName = "STUDENT"
},
new
{
Id = new Guid("c6f92bbf-190f-47a5-b4d6-ed6874a378e8"),
Id = new Guid("5f0c1b3c-ad05-4ca9-b9fd-a359cb518236"),
Name = "Teacher",
NormalizedName = "TEACHER"
},
new
{
Id = new Guid("8b814a50-fd96-4bfa-a666-b247c0f13e22"),
Id = new Guid("a81f5de2-9691-45fa-8d31-ae4ffeb34453"),
Name = "Administrator",
NormalizedName = "ADMINISTRATOR"
});
@@ -925,7 +927,8 @@ namespace TechHelper.Server.Migrations
{
b.HasOne("Entities.Contracts.AssignmentQuestion", "ParentAssignmentQuestion")
.WithMany("ChildrenAssignmentQuestion")
.HasForeignKey("ParentAssignmentQuestionId");
.HasForeignKey("ParentAssignmentQuestionId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Entities.Contracts.QuestionContext", "QuestionContext")
.WithMany("Questions")
@@ -985,7 +988,7 @@ namespace TechHelper.Server.Migrations
b.HasOne("Entities.Contracts.User", "Teacher")
.WithMany("TaughtClassesLink")
.HasForeignKey("TeacherId")
.OnDelete(DeleteBehavior.Restrict)
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Class");
@@ -1067,7 +1070,7 @@ namespace TechHelper.Server.Migrations
b.HasOne("Entities.Contracts.User", "Student")
.WithMany("SubmissionsAsStudent")
.HasForeignKey("StudentId")
.OnDelete(DeleteBehavior.Restrict)
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Assignment");
@@ -1088,7 +1091,7 @@ namespace TechHelper.Server.Migrations
b.HasOne("Entities.Contracts.User", "Student")
.WithMany("SubmissionDetails")
.HasForeignKey("StudentId")
.OnDelete(DeleteBehavior.Restrict)
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Entities.Contracts.Submission", "Submission")

View File

@@ -0,0 +1,153 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace TechHelper.Server.Migrations
{
/// <inheritdoc />
public partial class upd : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_assignment_questions_assignment_questions_parent_question_gr~",
table: "assignment_questions");
migrationBuilder.DropForeignKey(
name: "FK_submission_details_AspNetUsers_student_id",
table: "submission_details");
migrationBuilder.DropForeignKey(
name: "FK_submissions_AspNetUsers_student_id",
table: "submissions");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("3cfe35e8-73d5-4170-9856-f1d078554822"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("754c4967-6af2-4a81-b970-1e90a3a269b3"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("8546457c-185c-4b79-bece-bc21e41d02e7"));
migrationBuilder.AddColumn<string>(
name: "sequence",
table: "assignment_questions",
type: "longtext",
nullable: false)
.Annotation("MySql:CharSet", "utf8mb4");
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ new Guid("5f0c1b3c-ad05-4ca9-b9fd-a359cb518236"), null, "Teacher", "TEACHER" },
{ new Guid("a81f5de2-9691-45fa-8d31-ae4ffeb34453"), null, "Administrator", "ADMINISTRATOR" },
{ new Guid("c310acf7-9605-4c55-8b9f-9bf9cd2dadb9"), null, "Student", "STUDENT" }
});
migrationBuilder.AddForeignKey(
name: "FK_assignment_questions_assignment_questions_parent_question_gr~",
table: "assignment_questions",
column: "parent_question_group_id",
principalTable: "assignment_questions",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_submission_details_AspNetUsers_student_id",
table: "submission_details",
column: "student_id",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_submissions_AspNetUsers_student_id",
table: "submissions",
column: "student_id",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_assignment_questions_assignment_questions_parent_question_gr~",
table: "assignment_questions");
migrationBuilder.DropForeignKey(
name: "FK_submission_details_AspNetUsers_student_id",
table: "submission_details");
migrationBuilder.DropForeignKey(
name: "FK_submissions_AspNetUsers_student_id",
table: "submissions");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("5f0c1b3c-ad05-4ca9-b9fd-a359cb518236"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("a81f5de2-9691-45fa-8d31-ae4ffeb34453"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("c310acf7-9605-4c55-8b9f-9bf9cd2dadb9"));
migrationBuilder.DropColumn(
name: "sequence",
table: "assignment_questions");
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ new Guid("3cfe35e8-73d5-4170-9856-f1d078554822"), null, "Student", "STUDENT" },
{ new Guid("754c4967-6af2-4a81-b970-1e90a3a269b3"), null, "Teacher", "TEACHER" },
{ new Guid("8546457c-185c-4b79-bece-bc21e41d02e7"), null, "Administrator", "ADMINISTRATOR" }
});
migrationBuilder.AddForeignKey(
name: "FK_assignment_questions_assignment_questions_parent_question_gr~",
table: "assignment_questions",
column: "parent_question_group_id",
principalTable: "assignment_questions",
principalColumn: "id");
migrationBuilder.AddForeignKey(
name: "FK_submission_details_AspNetUsers_student_id",
table: "submission_details",
column: "student_id",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_submissions_AspNetUsers_student_id",
table: "submissions",
column: "student_id",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,71 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace TechHelper.Server.Migrations
{
/// <inheritdoc />
public partial class upde : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("5f0c1b3c-ad05-4ca9-b9fd-a359cb518236"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("a81f5de2-9691-45fa-8d31-ae4ffeb34453"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("c310acf7-9605-4c55-8b9f-9bf9cd2dadb9"));
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ new Guid("c0f247ab-b12a-432e-8ce7-d0e28811957e"), null, "Student", "STUDENT" },
{ new Guid("f282e759-deb5-4366-aaf1-51366131cf75"), null, "Administrator", "ADMINISTRATOR" },
{ new Guid("f9eeea07-eeda-4bbe-a2e4-6aef2f3c7c9a"), null, "Teacher", "TEACHER" }
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("c0f247ab-b12a-432e-8ce7-d0e28811957e"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("f282e759-deb5-4366-aaf1-51366131cf75"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("f9eeea07-eeda-4bbe-a2e4-6aef2f3c7c9a"));
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ new Guid("5f0c1b3c-ad05-4ca9-b9fd-a359cb518236"), null, "Teacher", "TEACHER" },
{ new Guid("a81f5de2-9691-45fa-8d31-ae4ffeb34453"), null, "Administrator", "ADMINISTRATOR" },
{ new Guid("c310acf7-9605-4c55-8b9f-9bf9cd2dadb9"), null, "Student", "STUDENT" }
});
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,102 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace TechHelper.Server.Migrations
{
/// <inheritdoc />
public partial class updedd : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("c0f247ab-b12a-432e-8ce7-d0e28811957e"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("f282e759-deb5-4366-aaf1-51366131cf75"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("f9eeea07-eeda-4bbe-a2e4-6aef2f3c7c9a"));
migrationBuilder.AddColumn<Guid>(
name: "AssignmentId",
table: "assignment_questions",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci");
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ new Guid("cf16c215-63f8-4962-8ad0-058274ecf944"), null, "Administrator", "ADMINISTRATOR" },
{ new Guid("e3bff43c-36af-497a-971c-ed0a487bdd38"), null, "Student", "STUDENT" },
{ new Guid("f05c125e-e70f-40eb-9e19-6e69c3426849"), null, "Teacher", "TEACHER" }
});
migrationBuilder.CreateIndex(
name: "IX_assignment_questions_AssignmentId",
table: "assignment_questions",
column: "AssignmentId");
migrationBuilder.AddForeignKey(
name: "FK_assignment_questions_assignments_AssignmentId",
table: "assignment_questions",
column: "AssignmentId",
principalTable: "assignments",
principalColumn: "id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_assignment_questions_assignments_AssignmentId",
table: "assignment_questions");
migrationBuilder.DropIndex(
name: "IX_assignment_questions_AssignmentId",
table: "assignment_questions");
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("cf16c215-63f8-4962-8ad0-058274ecf944"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("e3bff43c-36af-497a-971c-ed0a487bdd38"));
migrationBuilder.DeleteData(
table: "AspNetRoles",
keyColumn: "Id",
keyValue: new Guid("f05c125e-e70f-40eb-9e19-6e69c3426849"));
migrationBuilder.DropColumn(
name: "AssignmentId",
table: "assignment_questions");
migrationBuilder.InsertData(
table: "AspNetRoles",
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,]
{
{ new Guid("c0f247ab-b12a-432e-8ce7-d0e28811957e"), null, "Student", "STUDENT" },
{ new Guid("f282e759-deb5-4366-aaf1-51366131cf75"), null, "Administrator", "ADMINISTRATOR" },
{ new Guid("f9eeea07-eeda-4bbe-a2e4-6aef2f3c7c9a"), null, "Teacher", "TEACHER" }
});
}
}
}

View File

@@ -165,6 +165,9 @@ namespace TechHelper.Server.Migrations
.HasColumnType("char(36)")
.HasColumnName("id");
b.Property<Guid?>("AssignmentId")
.HasColumnType("char(36)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)")
.HasColumnName("created_at");
@@ -195,6 +198,11 @@ namespace TechHelper.Server.Migrations
.HasColumnType("float")
.HasColumnName("score");
b.Property<string>("Sequence")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("sequence");
b.Property<byte>("StructType")
.HasColumnType("tinyint unsigned")
.HasColumnName("group_state");
@@ -206,6 +214,8 @@ namespace TechHelper.Server.Migrations
b.HasKey("Id");
b.HasIndex("AssignmentId");
b.HasIndex("ParentAssignmentQuestionId");
b.HasIndex("QuestionContextId");
@@ -509,7 +519,6 @@ namespace TechHelper.Server.Migrations
.HasColumnName("deleted");
b.Property<string>("OverallFeedback")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("overall_feedback");
@@ -576,7 +585,6 @@ namespace TechHelper.Server.Migrations
.HasColumnName("points_awarded");
b.Property<string>("StudentAnswer")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("student_answer");
@@ -589,7 +597,6 @@ namespace TechHelper.Server.Migrations
.HasColumnName("submission_id");
b.Property<string>("TeacherFeedback")
.IsRequired()
.HasColumnType("longtext")
.HasColumnName("teacher_feedback");
@@ -744,19 +751,19 @@ namespace TechHelper.Server.Migrations
b.HasData(
new
{
Id = new Guid("a203eb76-97f0-418f-bc06-9549297d2ac3"),
Id = new Guid("e3bff43c-36af-497a-971c-ed0a487bdd38"),
Name = "Student",
NormalizedName = "STUDENT"
},
new
{
Id = new Guid("195b19c5-fd30-455c-9f38-9842b44bf5c3"),
Id = new Guid("f05c125e-e70f-40eb-9e19-6e69c3426849"),
Name = "Teacher",
NormalizedName = "TEACHER"
},
new
{
Id = new Guid("53cc63db-74bc-47a8-b71a-7e120d4018a9"),
Id = new Guid("cf16c215-63f8-4962-8ad0-058274ecf944"),
Name = "Administrator",
NormalizedName = "ADMINISTRATOR"
});
@@ -874,7 +881,7 @@ namespace TechHelper.Server.Migrations
.IsRequired();
b.HasOne("Entities.Contracts.AssignmentQuestion", "ExamStruct")
.WithOne("Assignment")
.WithOne()
.HasForeignKey("Entities.Contracts.Assignment", "ExamStructId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
@@ -920,9 +927,14 @@ namespace TechHelper.Server.Migrations
modelBuilder.Entity("Entities.Contracts.AssignmentQuestion", b =>
{
b.HasOne("Entities.Contracts.Assignment", "Assignment")
.WithMany()
.HasForeignKey("AssignmentId");
b.HasOne("Entities.Contracts.AssignmentQuestion", "ParentAssignmentQuestion")
.WithMany("ChildrenAssignmentQuestion")
.HasForeignKey("ParentAssignmentQuestionId");
.HasForeignKey("ParentAssignmentQuestionId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Entities.Contracts.QuestionContext", "QuestionContext")
.WithMany("Questions")
@@ -934,6 +946,8 @@ namespace TechHelper.Server.Migrations
.HasForeignKey("QuestionId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Assignment");
b.Navigation("ParentAssignmentQuestion");
b.Navigation("Question");
@@ -1064,7 +1078,7 @@ namespace TechHelper.Server.Migrations
b.HasOne("Entities.Contracts.User", "Student")
.WithMany("SubmissionsAsStudent")
.HasForeignKey("StudentId")
.OnDelete(DeleteBehavior.Restrict)
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Assignment");
@@ -1085,7 +1099,7 @@ namespace TechHelper.Server.Migrations
b.HasOne("Entities.Contracts.User", "Student")
.WithMany("SubmissionDetails")
.HasForeignKey("StudentId")
.OnDelete(DeleteBehavior.Restrict)
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Entities.Contracts.Submission", "Submission")
@@ -1163,8 +1177,6 @@ namespace TechHelper.Server.Migrations
modelBuilder.Entity("Entities.Contracts.AssignmentQuestion", b =>
{
b.Navigation("Assignment");
b.Navigation("ChildrenAssignmentQuestion");
b.Navigation("SubmissionDetails");