重构项目结构,移除Assignment相关功能,优化Submission模块
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 12s
This commit is contained in:
1235
TechHelper.Server/Migrations/20250626073834_init.Designer.cs
generated
1235
TechHelper.Server/Migrations/20250626073834_init.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
1241
TechHelper.Server/Migrations/20250627101025_upd.Designer.cs
generated
1241
TechHelper.Server/Migrations/20250627101025_upd.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -1,153 +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 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
1241
TechHelper.Server/Migrations/20250627101514_upde.Designer.cs
generated
1241
TechHelper.Server/Migrations/20250627101514_upde.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -1,71 +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 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
@@ -1,102 +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 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" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,82 +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 _update_submisstion_detail : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
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.AddColumn<int>(
|
||||
name: "status",
|
||||
table: "submission_details",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("14b8854f-a38b-4e72-878e-31ba2f7528b2"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("69c3cc0c-b284-433e-8493-9b1e7bd1eb1f"), null, "Student", "STUDENT" },
|
||||
{ new Guid("6ef4d2bb-05da-4c17-9152-4467d86939fc"), null, "Administrator", "ADMINISTRATOR" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("14b8854f-a38b-4e72-878e-31ba2f7528b2"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("69c3cc0c-b284-433e-8493-9b1e7bd1eb1f"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("6ef4d2bb-05da-4c17-9152-4467d86939fc"));
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "status",
|
||||
table: "submission_details");
|
||||
|
||||
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" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,89 +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 atemp_number_convert_to_byte : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("14b8854f-a38b-4e72-878e-31ba2f7528b2"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("69c3cc0c-b284-433e-8493-9b1e7bd1eb1f"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("6ef4d2bb-05da-4c17-9152-4467d86939fc"));
|
||||
|
||||
migrationBuilder.AlterColumn<byte>(
|
||||
name: "attempt_number",
|
||||
table: "submissions",
|
||||
type: "tinyint unsigned",
|
||||
nullable: false,
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "char(36)")
|
||||
.OldAnnotation("Relational:Collation", "ascii_general_ci");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("379143a2-8d7f-4ef7-b7c0-14701b710f87"), null, "Administrator", "ADMINISTRATOR" },
|
||||
{ new Guid("6d49bb08-97d6-4a38-88a7-8080925b589b"), null, "Student", "STUDENT" },
|
||||
{ new Guid("e330c745-f422-43e3-bcdf-1439ace3c52f"), null, "Teacher", "TEACHER" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("379143a2-8d7f-4ef7-b7c0-14701b710f87"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("6d49bb08-97d6-4a38-88a7-8080925b589b"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("e330c745-f422-43e3-bcdf-1439ace3c52f"));
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "attempt_number",
|
||||
table: "submissions",
|
||||
type: "char(36)",
|
||||
nullable: false,
|
||||
collation: "ascii_general_ci",
|
||||
oldClrType: typeof(byte),
|
||||
oldType: "tinyint unsigned");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("14b8854f-a38b-4e72-878e-31ba2f7528b2"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("69c3cc0c-b284-433e-8493-9b1e7bd1eb1f"), null, "Student", "STUDENT" },
|
||||
{ new Guid("6ef4d2bb-05da-4c17-9152-4467d86939fc"), null, "Administrator", "ADMINISTRATOR" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,104 +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 score_in_submission : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("379143a2-8d7f-4ef7-b7c0-14701b710f87"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("6d49bb08-97d6-4a38-88a7-8080925b589b"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("e330c745-f422-43e3-bcdf-1439ace3c52f"));
|
||||
|
||||
migrationBuilder.AddColumn<byte>(
|
||||
name: "ErrorQuesNum",
|
||||
table: "submissions",
|
||||
type: "tinyint unsigned",
|
||||
nullable: false,
|
||||
defaultValue: (byte)0);
|
||||
|
||||
migrationBuilder.AddColumn<byte>(
|
||||
name: "TotalQuesNum",
|
||||
table: "submissions",
|
||||
type: "tinyint unsigned",
|
||||
nullable: false,
|
||||
defaultValue: (byte)0);
|
||||
|
||||
migrationBuilder.AddColumn<byte>(
|
||||
name: "TotalScore",
|
||||
table: "submissions",
|
||||
type: "tinyint unsigned",
|
||||
nullable: false,
|
||||
defaultValue: (byte)0);
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("53307917-63c4-468a-ab05-a03882a69ef8"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("789b7819-685f-4a2b-9adf-463f397f24d1"), null, "Administrator", "ADMINISTRATOR" },
|
||||
{ new Guid("bbea7915-e27c-4ddc-b06c-1f579fc8104e"), null, "Student", "STUDENT" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("53307917-63c4-468a-ab05-a03882a69ef8"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("789b7819-685f-4a2b-9adf-463f397f24d1"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("bbea7915-e27c-4ddc-b06c-1f579fc8104e"));
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ErrorQuesNum",
|
||||
table: "submissions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TotalQuesNum",
|
||||
table: "submissions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TotalScore",
|
||||
table: "submissions");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("379143a2-8d7f-4ef7-b7c0-14701b710f87"), null, "Administrator", "ADMINISTRATOR" },
|
||||
{ new Guid("6d49bb08-97d6-4a38-88a7-8080925b589b"), null, "Student", "STUDENT" },
|
||||
{ new Guid("e330c745-f422-43e3-bcdf-1439ace3c52f"), null, "Teacher", "TEACHER" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,93 +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_assign_data : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("53307917-63c4-468a-ab05-a03882a69ef8"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("789b7819-685f-4a2b-9adf-463f397f24d1"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("bbea7915-e27c-4ddc-b06c-1f579fc8104e"));
|
||||
|
||||
migrationBuilder.AddColumn<byte>(
|
||||
name: "ExamType",
|
||||
table: "assignments",
|
||||
type: "tinyint unsigned",
|
||||
nullable: false,
|
||||
defaultValue: (byte)0);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Name",
|
||||
table: "assignments",
|
||||
type: "longtext",
|
||||
nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("0775702a-5db7-4747-94d0-4376fad2b58b"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("37f41430-0cb7-44e5-988b-976200bd602d"), null, "Administrator", "ADMINISTRATOR" },
|
||||
{ new Guid("df89b9a0-65ef-42dd-b2cb-e59997a72e70"), null, "Student", "STUDENT" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("0775702a-5db7-4747-94d0-4376fad2b58b"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("37f41430-0cb7-44e5-988b-976200bd602d"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("df89b9a0-65ef-42dd-b2cb-e59997a72e70"));
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ExamType",
|
||||
table: "assignments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Name",
|
||||
table: "assignments");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("53307917-63c4-468a-ab05-a03882a69ef8"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("789b7819-685f-4a2b-9adf-463f397f24d1"), null, "Administrator", "ADMINISTRATOR" },
|
||||
{ new Guid("bbea7915-e27c-4ddc-b06c-1f579fc8104e"), null, "Student", "STUDENT" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,93 +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 question_qt_update : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("0775702a-5db7-4747-94d0-4376fad2b58b"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("37f41430-0cb7-44e5-988b-976200bd602d"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("df89b9a0-65ef-42dd-b2cb-e59997a72e70"));
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "QType",
|
||||
table: "questions",
|
||||
type: "longtext",
|
||||
nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<byte>(
|
||||
name: "Type",
|
||||
table: "assignment_questions",
|
||||
type: "tinyint unsigned",
|
||||
nullable: false,
|
||||
defaultValue: (byte)0);
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("67de6514-79a5-4a9c-b54c-13cac296b0c6"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("94f0d8d9-ffba-4e28-b578-8596363d42ae"), null, "Student", "STUDENT" },
|
||||
{ new Guid("bf46ed67-2dc9-40f8-8717-37dd3572f274"), null, "Administrator", "ADMINISTRATOR" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("67de6514-79a5-4a9c-b54c-13cac296b0c6"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("94f0d8d9-ffba-4e28-b578-8596363d42ae"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("bf46ed67-2dc9-40f8-8717-37dd3572f274"));
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "QType",
|
||||
table: "questions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Type",
|
||||
table: "assignment_questions");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("0775702a-5db7-4747-94d0-4376fad2b58b"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("37f41430-0cb7-44e5-988b-976200bd602d"), null, "Administrator", "ADMINISTRATOR" },
|
||||
{ new Guid("df89b9a0-65ef-42dd-b2cb-e59997a72e70"), null, "Student", "STUDENT" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,89 +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 question_qt_update_2 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("67de6514-79a5-4a9c-b54c-13cac296b0c6"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("94f0d8d9-ffba-4e28-b578-8596363d42ae"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("bf46ed67-2dc9-40f8-8717-37dd3572f274"));
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "global",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
Area = table.Column<byte>(type: "tinyint unsigned", nullable: false),
|
||||
Info = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_global", x => x.id);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("49854839-b861-4d42-bdbe-96b1a66c25ef"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("5c7a7971-2610-4bce-9e41-0caffd5a5558"), null, "Student", "STUDENT" },
|
||||
{ new Guid("83ff7de8-edc9-47f8-8de8-22f892ca6bb5"), null, "Administrator", "ADMINISTRATOR" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "global");
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("49854839-b861-4d42-bdbe-96b1a66c25ef"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("5c7a7971-2610-4bce-9e41-0caffd5a5558"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("83ff7de8-edc9-47f8-8de8-22f892ca6bb5"));
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("67de6514-79a5-4a9c-b54c-13cac296b0c6"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("94f0d8d9-ffba-4e28-b578-8596363d42ae"), null, "Student", "STUDENT" },
|
||||
{ new Guid("bf46ed67-2dc9-40f8-8717-37dd3572f274"), null, "Administrator", "ADMINISTRATOR" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,82 +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 question_qt_update_3 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("49854839-b861-4d42-bdbe-96b1a66c25ef"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("5c7a7971-2610-4bce-9e41-0caffd5a5558"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("83ff7de8-edc9-47f8-8de8-22f892ca6bb5"));
|
||||
|
||||
migrationBuilder.AddColumn<byte>(
|
||||
name: "SubjectArea",
|
||||
table: "AspNetUsers",
|
||||
type: "tinyint unsigned",
|
||||
nullable: false,
|
||||
defaultValue: (byte)0);
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("2670f35a-df0c-4071-8879-80eb99d138a1"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("8c6c5e8e-ef00-444c-9c7c-cba5cd6f7043"), null, "Student", "STUDENT" },
|
||||
{ new Guid("9eda9d90-0cd2-4fbe-b07e-f90bd01f32db"), null, "Administrator", "ADMINISTRATOR" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("2670f35a-df0c-4071-8879-80eb99d138a1"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("8c6c5e8e-ef00-444c-9c7c-cba5cd6f7043"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("9eda9d90-0cd2-4fbe-b07e-f90bd01f32db"));
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SubjectArea",
|
||||
table: "AspNetUsers");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("49854839-b861-4d42-bdbe-96b1a66c25ef"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("5c7a7971-2610-4bce-9e41-0caffd5a5558"), null, "Student", "STUDENT" },
|
||||
{ new Guid("83ff7de8-edc9-47f8-8de8-22f892ca6bb5"), null, "Administrator", "ADMINISTRATOR" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,97 +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 submission_up_2 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("2670f35a-df0c-4071-8879-80eb99d138a1"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("8c6c5e8e-ef00-444c-9c7c-cba5cd6f7043"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("9eda9d90-0cd2-4fbe-b07e-f90bd01f32db"));
|
||||
|
||||
migrationBuilder.AlterColumn<float>(
|
||||
name: "overall_grade",
|
||||
table: "submissions",
|
||||
type: "float",
|
||||
precision: 5,
|
||||
scale: 2,
|
||||
nullable: false,
|
||||
defaultValue: 0f,
|
||||
oldClrType: typeof(float),
|
||||
oldType: "float",
|
||||
oldPrecision: 5,
|
||||
oldScale: 2,
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("264e4290-9d15-478d-8c49-8d0935e5a6e1"), null, "Administrator", "ADMINISTRATOR" },
|
||||
{ new Guid("73cafcee-3e99-43ae-86c5-c01a1cbc6124"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("f06927ff-4bba-4ab6-8f0a-e45a765c2fcc"), null, "Student", "STUDENT" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("264e4290-9d15-478d-8c49-8d0935e5a6e1"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("73cafcee-3e99-43ae-86c5-c01a1cbc6124"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("f06927ff-4bba-4ab6-8f0a-e45a765c2fcc"));
|
||||
|
||||
migrationBuilder.AlterColumn<float>(
|
||||
name: "overall_grade",
|
||||
table: "submissions",
|
||||
type: "float",
|
||||
precision: 5,
|
||||
scale: 2,
|
||||
nullable: true,
|
||||
oldClrType: typeof(float),
|
||||
oldType: "float",
|
||||
oldPrecision: 5,
|
||||
oldScale: 2);
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("2670f35a-df0c-4071-8879-80eb99d138a1"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("8c6c5e8e-ef00-444c-9c7c-cba5cd6f7043"), null, "Student", "STUDENT" },
|
||||
{ new Guid("9eda9d90-0cd2-4fbe-b07e-f90bd01f32db"), null, "Administrator", "ADMINISTRATOR" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,71 +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 submission_up_3 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("264e4290-9d15-478d-8c49-8d0935e5a6e1"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("73cafcee-3e99-43ae-86c5-c01a1cbc6124"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("f06927ff-4bba-4ab6-8f0a-e45a765c2fcc"));
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("388fdb1d-8cd5-4e8f-b49c-06dbee60527b"), null, "Administrator", "ADMINISTRATOR" },
|
||||
{ new Guid("ba4054d5-2f8a-4c7f-bd56-0fc864720c7d"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("c758a0d2-faea-4cf1-aa14-d162f3d0a1e9"), null, "Student", "STUDENT" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("388fdb1d-8cd5-4e8f-b49c-06dbee60527b"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("ba4054d5-2f8a-4c7f-bd56-0fc864720c7d"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("c758a0d2-faea-4cf1-aa14-d162f3d0a1e9"));
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("264e4290-9d15-478d-8c49-8d0935e5a6e1"), null, "Administrator", "ADMINISTRATOR" },
|
||||
{ new Guid("73cafcee-3e99-43ae-86c5-c01a1cbc6124"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("f06927ff-4bba-4ab6-8f0a-e45a765c2fcc"), null, "Student", "STUDENT" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,82 +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 tee : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("388fdb1d-8cd5-4e8f-b49c-06dbee60527b"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("ba4054d5-2f8a-4c7f-bd56-0fc864720c7d"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("c758a0d2-faea-4cf1-aa14-d162f3d0a1e9"));
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "BCorrect",
|
||||
table: "assignment_questions",
|
||||
type: "tinyint(1)",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("d480cdca-7de2-4abe-8129-73bbaa6c1b32"), null, "Student", "STUDENT" },
|
||||
{ new Guid("d7bcfb37-3f1c-467b-a3f0-b2339a8a990d"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("f4a6788a-04d8-499c-9e64-73dfba97ca6b"), null, "Administrator", "ADMINISTRATOR" }
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("d480cdca-7de2-4abe-8129-73bbaa6c1b32"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("d7bcfb37-3f1c-467b-a3f0-b2339a8a990d"));
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "AspNetRoles",
|
||||
keyColumn: "Id",
|
||||
keyValue: new Guid("f4a6788a-04d8-499c-9e64-73dfba97ca6b"));
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "BCorrect",
|
||||
table: "assignment_questions");
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "AspNetRoles",
|
||||
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ new Guid("388fdb1d-8cd5-4e8f-b49c-06dbee60527b"), null, "Administrator", "ADMINISTRATOR" },
|
||||
{ new Guid("ba4054d5-2f8a-4c7f-bd56-0fc864720c7d"), null, "Teacher", "TEACHER" },
|
||||
{ new Guid("c758a0d2-faea-4cf1-aa14-d162f3d0a1e9"), null, "Student", "STUDENT" }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,8 +4,6 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
|
||||
|
||||
namespace TechHelper.Server.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
@@ -36,44 +34,18 @@ namespace TechHelper.Server.Migrations
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetUsers",
|
||||
name: "exam_type",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
RefreshToken = table.Column<string>(type: "longtext", nullable: true)
|
||||
id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
name = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
RefreshTokenExpiryTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
||||
Address = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DisplayName = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
UserName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
NormalizedUserName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Email = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
NormalizedEmail = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
EmailConfirmed = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
PasswordHash = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
SecurityStamp = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
ConcurrencyStamp = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PhoneNumber = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PhoneNumberConfirmed = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
TwoFactorEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
LockoutEnd = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
|
||||
LockoutEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
AccessFailedCount = table.Column<int>(type: "int", nullable: false)
|
||||
description = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
|
||||
table.PrimaryKey("PK_exam_type", x => x.id);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
@@ -91,6 +63,39 @@ namespace TechHelper.Server.Migrations
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "schools",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
school_name = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
address = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
create_time = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_schools", x => x.id);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "subjects",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
name = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
description = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_subjects", x => x.id);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "textbook",
|
||||
columns: table => new
|
||||
@@ -132,6 +137,125 @@ namespace TechHelper.Server.Migrations
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "grades",
|
||||
columns: table => new
|
||||
{
|
||||
grade_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
school_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
grade_name = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
grade_level = table.Column<byte>(type: "tinyint unsigned", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_grades", x => x.grade_id);
|
||||
table.ForeignKey(
|
||||
name: "FK_grades_schools_school_id",
|
||||
column: x => x.school_id,
|
||||
principalTable: "schools",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetUsers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
RefreshToken = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
RefreshTokenExpiryTime = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
||||
HomeAddress = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DisplayName = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Role = table.Column<int>(type: "int", nullable: true),
|
||||
TeachSubjectId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
UserName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
NormalizedUserName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Email = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
NormalizedEmail = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
EmailConfirmed = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
PasswordHash = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
SecurityStamp = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
ConcurrencyStamp = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PhoneNumber = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PhoneNumberConfirmed = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
TwoFactorEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
LockoutEnd = table.Column<DateTimeOffset>(type: "datetime(6)", nullable: true),
|
||||
LockoutEnabled = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
AccessFailedCount = table.Column<int>(type: "int", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_AspNetUsers_subjects_TeachSubjectId",
|
||||
column: x => x.TeachSubjectId,
|
||||
principalTable: "subjects",
|
||||
principalColumn: "id");
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "question_types",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
name = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
subject_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
description = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
score_rule = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_question_types", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_question_types_subjects_subject_id",
|
||||
column: x => x.subject_id,
|
||||
principalTable: "subjects",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "lesson",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
Title = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Description = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
TextbookID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_lesson", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_lesson_textbook_TextbookID",
|
||||
column: x => x.TextbookID,
|
||||
principalTable: "textbook",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "AspNetUserClaims",
|
||||
columns: table => new
|
||||
@@ -233,102 +357,29 @@ namespace TechHelper.Server.Migrations
|
||||
name: "classes",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
grade = table.Column<byte>(type: "tinyint unsigned", nullable: false),
|
||||
@class = table.Column<byte>(name: "class", type: "tinyint unsigned", nullable: false),
|
||||
description = table.Column<string>(type: "longtext", nullable: true)
|
||||
class_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
grade_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
index = table.Column<byte>(type: "tinyint unsigned", nullable: false),
|
||||
class_name = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
head_teacher_id = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
created_at = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
updated_at = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false)
|
||||
created_at = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
updated_at = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_classes", x => x.id);
|
||||
table.PrimaryKey("PK_classes", x => x.class_id);
|
||||
table.ForeignKey(
|
||||
name: "FK_classes_AspNetUsers_head_teacher_id",
|
||||
column: x => x.head_teacher_id,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "lesson",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
Title = table.Column<string>(type: "varchar(255)", maxLength: 255, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Description = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
TextbookID = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_lesson", x => x.Id);
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_lesson_textbook_TextbookID",
|
||||
column: x => x.TextbookID,
|
||||
principalTable: "textbook",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "class_student",
|
||||
columns: table => new
|
||||
{
|
||||
class_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"),
|
||||
enrollment_date = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_class_student", x => new { x.class_id, x.student_id });
|
||||
table.ForeignKey(
|
||||
name: "FK_class_student_AspNetUsers_student_id",
|
||||
column: x => x.student_id,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_class_student_classes_class_id",
|
||||
column: x => x.class_id,
|
||||
principalTable: "classes",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "class_teachers",
|
||||
columns: table => new
|
||||
{
|
||||
class_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
teacher_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
subject_taught = table.Column<byte>(type: "tinyint unsigned", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_class_teachers", x => new { x.class_id, x.teacher_id });
|
||||
table.ForeignKey(
|
||||
name: "FK_class_teachers_AspNetUsers_teacher_id",
|
||||
column: x => x.teacher_id,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_class_teachers_classes_class_id",
|
||||
column: x => x.class_id,
|
||||
principalTable: "classes",
|
||||
principalColumn: "id",
|
||||
name: "FK_classes_grades_grade_id",
|
||||
column: x => x.grade_id,
|
||||
principalTable: "grades",
|
||||
principalColumn: "grade_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
@@ -375,49 +426,77 @@ namespace TechHelper.Server.Migrations
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "class_user",
|
||||
columns: table => new
|
||||
{
|
||||
class_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"),
|
||||
enrollment_date = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_class_user", x => new { x.class_id, x.student_id });
|
||||
table.ForeignKey(
|
||||
name: "FK_class_user_AspNetUsers_student_id",
|
||||
column: x => x.student_id,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_class_user_classes_class_id",
|
||||
column: x => x.class_id,
|
||||
principalTable: "classes",
|
||||
principalColumn: "class_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "questions",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
question_text = table.Column<string>(type: "longtext", maxLength: 65535, nullable: false)
|
||||
title = table.Column<string>(type: "longtext", maxLength: 65535, nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
correct_answer = table.Column<string>(type: "longtext", maxLength: 65535, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
question_type = table.Column<byte>(type: "tinyint unsigned", maxLength: 20, nullable: false),
|
||||
difficulty_level = table.Column<byte>(type: "tinyint unsigned", maxLength: 10, nullable: false),
|
||||
subject_area = table.Column<byte>(type: "tinyint unsigned", maxLength: 100, nullable: false),
|
||||
options = table.Column<string>(type: "longtext", nullable: true)
|
||||
answer = table.Column<string>(type: "longtext", maxLength: 65535, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
type = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
subject_area = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
key_point = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
lesson = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
created_by = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
created_at = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
updated_at = table.Column<DateTime>(type: "datetime(6)", rowVersion: true, nullable: false),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false)
|
||||
options = table.Column<string>(type: "longtext", nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
created_at = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
updated_at = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_questions", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_questions_AspNetUsers_created_by",
|
||||
column: x => x.created_by,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_questions_key_point_key_point",
|
||||
column: x => x.key_point,
|
||||
principalTable: "key_point",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_questions_lesson_lesson",
|
||||
column: x => x.lesson,
|
||||
principalTable: "lesson",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_questions_question_types_type",
|
||||
column: x => x.type,
|
||||
principalTable: "question_types",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_questions_subjects_subject_area",
|
||||
column: x => x.subject_area,
|
||||
principalTable: "subjects",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
@@ -426,16 +505,18 @@ namespace TechHelper.Server.Migrations
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
question_id = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
title = table.Column<string>(type: "varchar(1024)", maxLength: 1024, nullable: true)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
question_id = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
description = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
question_number = table.Column<byte>(type: "tinyint unsigned", nullable: false),
|
||||
sequence = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
parent_question_group_id = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
group_state = table.Column<byte>(type: "tinyint unsigned", nullable: false),
|
||||
QuestionTypeId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
created_at = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
score = table.Column<float>(type: "float", nullable: true),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false)
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -444,19 +525,23 @@ namespace TechHelper.Server.Migrations
|
||||
name: "FK_assignment_questions_QuestionContexts_description",
|
||||
column: x => x.description,
|
||||
principalTable: "QuestionContexts",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_assignment_questions_assignment_questions_parent_question_gr~",
|
||||
column: x => x.parent_question_group_id,
|
||||
principalTable: "assignment_questions",
|
||||
principalColumn: "id");
|
||||
table.ForeignKey(
|
||||
name: "FK_assignment_questions_question_types_QuestionTypeId",
|
||||
column: x => x.QuestionTypeId,
|
||||
principalTable: "question_types",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_assignment_questions_questions_question_id",
|
||||
column: x => x.question_id,
|
||||
principalTable: "questions",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
principalColumn: "id");
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
@@ -469,25 +554,22 @@ namespace TechHelper.Server.Migrations
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
description = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
subject_area = table.Column<byte>(type: "tinyint unsigned", nullable: false),
|
||||
subject_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
exam_struct_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
exam_type_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
created_by = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
due_date = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
total_points = table.Column<byte>(type: "tinyint unsigned", nullable: false),
|
||||
score = table.Column<float>(type: "float", nullable: false),
|
||||
created_by = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
name = table.Column<string>(type: "longtext", nullable: false)
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
created_at = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
updated_at = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_assignments", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "FK_assignments_AspNetUsers_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_assignments_AspNetUsers_created_by",
|
||||
column: x => x.created_by,
|
||||
@@ -500,6 +582,18 @@ namespace TechHelper.Server.Migrations
|
||||
principalTable: "assignment_questions",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_assignments_exam_type_exam_type_id",
|
||||
column: x => x.exam_type_id,
|
||||
principalTable: "exam_type",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_assignments_subjects_subject_id",
|
||||
column: x => x.subject_id,
|
||||
principalTable: "subjects",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
@@ -528,49 +622,26 @@ namespace TechHelper.Server.Migrations
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "assignment_class",
|
||||
columns: table => new
|
||||
{
|
||||
assignment_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
class_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
assigned_at = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_assignment_class", x => new { x.assignment_id, x.class_id });
|
||||
table.ForeignKey(
|
||||
name: "FK_assignment_class_assignments_assignment_id",
|
||||
column: x => x.assignment_id,
|
||||
principalTable: "assignments",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_assignment_class_classes_class_id",
|
||||
column: x => x.class_id,
|
||||
principalTable: "classes",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "submissions",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
assignment_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
exam_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"),
|
||||
attempt_number = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
graded_by = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci"),
|
||||
class_id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
attempt_number = table.Column<byte>(type: "tinyint unsigned", nullable: false),
|
||||
submission_time = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
overall_grade = table.Column<float>(type: "float", precision: 5, scale: 2, nullable: true),
|
||||
overall_grade = table.Column<float>(type: "float", 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),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false),
|
||||
status = table.Column<int>(type: "int", maxLength: 15, nullable: false)
|
||||
TotalQuesNum = table.Column<byte>(type: "tinyint unsigned", nullable: false),
|
||||
ErrorQuesNum = table.Column<byte>(type: "tinyint unsigned", nullable: false),
|
||||
TotalScore = table.Column<byte>(type: "tinyint unsigned", nullable: false),
|
||||
status = table.Column<int>(type: "int", nullable: false),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -579,20 +650,25 @@ namespace TechHelper.Server.Migrations
|
||||
name: "FK_submissions_AspNetUsers_graded_by",
|
||||
column: x => x.graded_by,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_submissions_AspNetUsers_student_id",
|
||||
column: x => x.student_id,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_submissions_assignments_assignment_id",
|
||||
column: x => x.assignment_id,
|
||||
name: "FK_submissions_assignments_exam_id",
|
||||
column: x => x.exam_id,
|
||||
principalTable: "assignments",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_submissions_classes_class_id",
|
||||
column: x => x.class_id,
|
||||
principalTable: "classes",
|
||||
principalColumn: "class_id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
@@ -607,13 +683,12 @@ namespace TechHelper.Server.Migrations
|
||||
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),
|
||||
points_awarded = table.Column<float>(type: "float", nullable: true),
|
||||
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),
|
||||
updated_at = table.Column<DateTime>(type: "datetime(6)", rowVersion: true, nullable: false),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false, defaultValue: false)
|
||||
created_at = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
updated_at = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
deleted = table.Column<bool>(type: "tinyint(1)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
@@ -623,7 +698,7 @@ namespace TechHelper.Server.Migrations
|
||||
column: x => x.student_id,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_submission_details_assignment_questions_assignment_question_~",
|
||||
column: x => x.assignment_question_id,
|
||||
@@ -639,16 +714,6 @@ namespace TechHelper.Server.Migrations
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
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.CreateIndex(
|
||||
name: "IX_AspNetRoleClaims_RoleId",
|
||||
table: "AspNetRoleClaims",
|
||||
@@ -680,6 +745,11 @@ namespace TechHelper.Server.Migrations
|
||||
table: "AspNetUsers",
|
||||
column: "NormalizedEmail");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_AspNetUsers_TeachSubjectId",
|
||||
table: "AspNetUsers",
|
||||
column: "TeachSubjectId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "UserNameIndex",
|
||||
table: "AspNetUsers",
|
||||
@@ -691,11 +761,6 @@ namespace TechHelper.Server.Migrations
|
||||
table: "assignment_attachments",
|
||||
column: "assignment_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_assignment_class_class_id",
|
||||
table: "assignment_class",
|
||||
column: "class_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_assignment_questions_description",
|
||||
table: "assignment_questions",
|
||||
@@ -711,6 +776,11 @@ namespace TechHelper.Server.Migrations
|
||||
table: "assignment_questions",
|
||||
column: "question_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_assignment_questions_QuestionTypeId",
|
||||
table: "assignment_questions",
|
||||
column: "QuestionTypeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_assignments_created_by",
|
||||
table: "assignments",
|
||||
@@ -723,25 +793,35 @@ namespace TechHelper.Server.Migrations
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_assignments_UserId",
|
||||
name: "IX_assignments_exam_type_id",
|
||||
table: "assignments",
|
||||
column: "UserId");
|
||||
column: "exam_type_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_class_student_student_id",
|
||||
table: "class_student",
|
||||
name: "IX_assignments_subject_id",
|
||||
table: "assignments",
|
||||
column: "subject_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_class_user_student_id",
|
||||
table: "class_user",
|
||||
column: "student_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_class_teachers_teacher_id",
|
||||
table: "class_teachers",
|
||||
column: "teacher_id");
|
||||
name: "IX_classes_grade_id",
|
||||
table: "classes",
|
||||
column: "grade_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_classes_head_teacher_id",
|
||||
table: "classes",
|
||||
column: "head_teacher_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_grades_school_id",
|
||||
table: "grades",
|
||||
column: "school_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_key_point_LessonID",
|
||||
table: "key_point",
|
||||
@@ -758,9 +838,9 @@ namespace TechHelper.Server.Migrations
|
||||
column: "LessonID");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_questions_created_by",
|
||||
table: "questions",
|
||||
column: "created_by");
|
||||
name: "IX_question_types_subject_id",
|
||||
table: "question_types",
|
||||
column: "subject_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_questions_key_point",
|
||||
@@ -773,10 +853,14 @@ namespace TechHelper.Server.Migrations
|
||||
column: "lesson");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_questions_question_text",
|
||||
name: "IX_questions_subject_area",
|
||||
table: "questions",
|
||||
column: "question_text")
|
||||
.Annotation("MySql:IndexPrefixLength", new[] { 20 });
|
||||
column: "subject_area");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_questions_type",
|
||||
table: "questions",
|
||||
column: "type");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_submission_details_assignment_question_id",
|
||||
@@ -794,9 +878,14 @@ namespace TechHelper.Server.Migrations
|
||||
column: "submission_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_submissions_assignment_id",
|
||||
name: "IX_submissions_class_id",
|
||||
table: "submissions",
|
||||
column: "assignment_id");
|
||||
column: "class_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_submissions_exam_id",
|
||||
table: "submissions",
|
||||
column: "exam_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_submissions_graded_by",
|
||||
@@ -831,13 +920,7 @@ namespace TechHelper.Server.Migrations
|
||||
name: "assignment_attachments");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "assignment_class");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "class_student");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "class_teachers");
|
||||
name: "class_user");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "lesson_question");
|
||||
@@ -848,18 +931,27 @@ namespace TechHelper.Server.Migrations
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetRoles");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "classes");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "submissions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "assignments");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "classes");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "assignment_questions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "exam_type");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetUsers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "grades");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "QuestionContexts");
|
||||
|
||||
@@ -867,14 +959,20 @@ namespace TechHelper.Server.Migrations
|
||||
name: "questions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "AspNetUsers");
|
||||
name: "schools");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "key_point");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "question_types");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "lesson");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "subjects");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "textbook");
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
501
TechHelper.Server/Migrations/20250929093304_temp_1.cs
Normal file
501
TechHelper.Server/Migrations/20250929093304_temp_1.cs
Normal file
@@ -0,0 +1,501 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TechHelper.Server.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class temp_1 : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_assignment_attachments_assignments_assignment_id",
|
||||
table: "assignment_attachments");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_assignment_questions_QuestionContexts_description",
|
||||
table: "assignment_questions");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_assignment_questions_assignment_questions_parent_question_gr~",
|
||||
table: "assignment_questions");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_assignment_questions_question_types_QuestionTypeId",
|
||||
table: "assignment_questions");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_assignment_questions_questions_question_id",
|
||||
table: "assignment_questions");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_assignments_AspNetUsers_created_by",
|
||||
table: "assignments");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_assignments_assignment_questions_exam_struct_id",
|
||||
table: "assignments");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_assignments_exam_type_exam_type_id",
|
||||
table: "assignments");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_assignments_subjects_subject_id",
|
||||
table: "assignments");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_submission_details_assignment_questions_assignment_question_~",
|
||||
table: "submission_details");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_submissions_assignments_exam_id",
|
||||
table: "submissions");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_assignments",
|
||||
table: "assignments");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_assignment_questions",
|
||||
table: "assignment_questions");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_assignment_attachments",
|
||||
table: "assignment_attachments");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "assignments",
|
||||
newName: "exams");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "assignment_questions",
|
||||
newName: "exam_questions");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "assignment_attachments",
|
||||
newName: "exam_attachments");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "assignment_question_id",
|
||||
table: "submission_details",
|
||||
newName: "exam_question_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_submission_details_assignment_question_id",
|
||||
table: "submission_details",
|
||||
newName: "IX_submission_details_exam_question_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_assignments_subject_id",
|
||||
table: "exams",
|
||||
newName: "IX_exams_subject_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_assignments_exam_type_id",
|
||||
table: "exams",
|
||||
newName: "IX_exams_exam_type_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_assignments_exam_struct_id",
|
||||
table: "exams",
|
||||
newName: "IX_exams_exam_struct_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_assignments_created_by",
|
||||
table: "exams",
|
||||
newName: "IX_exams_created_by");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_assignment_questions_QuestionTypeId",
|
||||
table: "exam_questions",
|
||||
newName: "IX_exam_questions_QuestionTypeId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_assignment_questions_question_id",
|
||||
table: "exam_questions",
|
||||
newName: "IX_exam_questions_question_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_assignment_questions_parent_question_group_id",
|
||||
table: "exam_questions",
|
||||
newName: "IX_exam_questions_parent_question_group_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_assignment_questions_description",
|
||||
table: "exam_questions",
|
||||
newName: "IX_exam_questions_description");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "assignment_id",
|
||||
table: "exam_attachments",
|
||||
newName: "exam_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_assignment_attachments_assignment_id",
|
||||
table: "exam_attachments",
|
||||
newName: "IX_exam_attachments_exam_id");
|
||||
|
||||
migrationBuilder.AlterColumn<float>(
|
||||
name: "TotalScore",
|
||||
table: "submissions",
|
||||
type: "float",
|
||||
nullable: false,
|
||||
oldClrType: typeof(byte),
|
||||
oldType: "tinyint unsigned");
|
||||
|
||||
migrationBuilder.AddColumn<byte>(
|
||||
name: "exam_struct_type",
|
||||
table: "exam_questions",
|
||||
type: "tinyint unsigned",
|
||||
nullable: false,
|
||||
defaultValue: (byte)0);
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_exams",
|
||||
table: "exams",
|
||||
column: "id");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_exam_questions",
|
||||
table: "exam_questions",
|
||||
column: "id");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_exam_attachments",
|
||||
table: "exam_attachments",
|
||||
column: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_exam_attachments_exams_exam_id",
|
||||
table: "exam_attachments",
|
||||
column: "exam_id",
|
||||
principalTable: "exams",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_exam_questions_QuestionContexts_description",
|
||||
table: "exam_questions",
|
||||
column: "description",
|
||||
principalTable: "QuestionContexts",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_exam_questions_exam_questions_parent_question_group_id",
|
||||
table: "exam_questions",
|
||||
column: "parent_question_group_id",
|
||||
principalTable: "exam_questions",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_exam_questions_question_types_QuestionTypeId",
|
||||
table: "exam_questions",
|
||||
column: "QuestionTypeId",
|
||||
principalTable: "question_types",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_exam_questions_questions_question_id",
|
||||
table: "exam_questions",
|
||||
column: "question_id",
|
||||
principalTable: "questions",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_exams_AspNetUsers_created_by",
|
||||
table: "exams",
|
||||
column: "created_by",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_exams_exam_questions_exam_struct_id",
|
||||
table: "exams",
|
||||
column: "exam_struct_id",
|
||||
principalTable: "exam_questions",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_exams_exam_type_exam_type_id",
|
||||
table: "exams",
|
||||
column: "exam_type_id",
|
||||
principalTable: "exam_type",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_exams_subjects_subject_id",
|
||||
table: "exams",
|
||||
column: "subject_id",
|
||||
principalTable: "subjects",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_submission_details_exam_questions_exam_question_id",
|
||||
table: "submission_details",
|
||||
column: "exam_question_id",
|
||||
principalTable: "exam_questions",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_submissions_exams_exam_id",
|
||||
table: "submissions",
|
||||
column: "exam_id",
|
||||
principalTable: "exams",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_exam_attachments_exams_exam_id",
|
||||
table: "exam_attachments");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_exam_questions_QuestionContexts_description",
|
||||
table: "exam_questions");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_exam_questions_exam_questions_parent_question_group_id",
|
||||
table: "exam_questions");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_exam_questions_question_types_QuestionTypeId",
|
||||
table: "exam_questions");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_exam_questions_questions_question_id",
|
||||
table: "exam_questions");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_exams_AspNetUsers_created_by",
|
||||
table: "exams");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_exams_exam_questions_exam_struct_id",
|
||||
table: "exams");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_exams_exam_type_exam_type_id",
|
||||
table: "exams");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_exams_subjects_subject_id",
|
||||
table: "exams");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_submission_details_exam_questions_exam_question_id",
|
||||
table: "submission_details");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_submissions_exams_exam_id",
|
||||
table: "submissions");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_exams",
|
||||
table: "exams");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_exam_questions",
|
||||
table: "exam_questions");
|
||||
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_exam_attachments",
|
||||
table: "exam_attachments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "exam_struct_type",
|
||||
table: "exam_questions");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "exams",
|
||||
newName: "assignments");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "exam_questions",
|
||||
newName: "assignment_questions");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "exam_attachments",
|
||||
newName: "assignment_attachments");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "exam_question_id",
|
||||
table: "submission_details",
|
||||
newName: "assignment_question_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_submission_details_exam_question_id",
|
||||
table: "submission_details",
|
||||
newName: "IX_submission_details_assignment_question_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_exams_subject_id",
|
||||
table: "assignments",
|
||||
newName: "IX_assignments_subject_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_exams_exam_type_id",
|
||||
table: "assignments",
|
||||
newName: "IX_assignments_exam_type_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_exams_exam_struct_id",
|
||||
table: "assignments",
|
||||
newName: "IX_assignments_exam_struct_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_exams_created_by",
|
||||
table: "assignments",
|
||||
newName: "IX_assignments_created_by");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_exam_questions_QuestionTypeId",
|
||||
table: "assignment_questions",
|
||||
newName: "IX_assignment_questions_QuestionTypeId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_exam_questions_question_id",
|
||||
table: "assignment_questions",
|
||||
newName: "IX_assignment_questions_question_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_exam_questions_parent_question_group_id",
|
||||
table: "assignment_questions",
|
||||
newName: "IX_assignment_questions_parent_question_group_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_exam_questions_description",
|
||||
table: "assignment_questions",
|
||||
newName: "IX_assignment_questions_description");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "exam_id",
|
||||
table: "assignment_attachments",
|
||||
newName: "assignment_id");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_exam_attachments_exam_id",
|
||||
table: "assignment_attachments",
|
||||
newName: "IX_assignment_attachments_assignment_id");
|
||||
|
||||
migrationBuilder.AlterColumn<byte>(
|
||||
name: "TotalScore",
|
||||
table: "submissions",
|
||||
type: "tinyint unsigned",
|
||||
nullable: false,
|
||||
oldClrType: typeof(float),
|
||||
oldType: "float");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_assignments",
|
||||
table: "assignments",
|
||||
column: "id");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_assignment_questions",
|
||||
table: "assignment_questions",
|
||||
column: "id");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_assignment_attachments",
|
||||
table: "assignment_attachments",
|
||||
column: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_assignment_attachments_assignments_assignment_id",
|
||||
table: "assignment_attachments",
|
||||
column: "assignment_id",
|
||||
principalTable: "assignments",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_assignment_questions_QuestionContexts_description",
|
||||
table: "assignment_questions",
|
||||
column: "description",
|
||||
principalTable: "QuestionContexts",
|
||||
principalColumn: "Id");
|
||||
|
||||
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_assignment_questions_question_types_QuestionTypeId",
|
||||
table: "assignment_questions",
|
||||
column: "QuestionTypeId",
|
||||
principalTable: "question_types",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_assignment_questions_questions_question_id",
|
||||
table: "assignment_questions",
|
||||
column: "question_id",
|
||||
principalTable: "questions",
|
||||
principalColumn: "id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_assignments_AspNetUsers_created_by",
|
||||
table: "assignments",
|
||||
column: "created_by",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_assignments_assignment_questions_exam_struct_id",
|
||||
table: "assignments",
|
||||
column: "exam_struct_id",
|
||||
principalTable: "assignment_questions",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_assignments_exam_type_exam_type_id",
|
||||
table: "assignments",
|
||||
column: "exam_type_id",
|
||||
principalTable: "exam_type",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_assignments_subjects_subject_id",
|
||||
table: "assignments",
|
||||
column: "subject_id",
|
||||
principalTable: "subjects",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_submission_details_assignment_questions_assignment_question_~",
|
||||
table: "submission_details",
|
||||
column: "assignment_question_id",
|
||||
principalTable: "assignment_questions",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_submissions_assignments_exam_id",
|
||||
table: "submissions",
|
||||
column: "exam_id",
|
||||
principalTable: "assignments",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user