This commit is contained in:
SpecialX
2025-07-01 19:05:07 +08:00
parent a21ca80782
commit 017cc2169c
33 changed files with 3778 additions and 109 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,82 @@
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

View File

@@ -0,0 +1,89 @@
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" }
});
}
}
}

View File

@@ -500,8 +500,8 @@ namespace TechHelper.Server.Migrations
.HasColumnType("char(36)")
.HasColumnName("assignment_id");
b.Property<Guid>("AttemptNumber")
.HasColumnType("char(36)")
b.Property<byte>("AttemptNumber")
.HasColumnType("tinyint unsigned")
.HasColumnName("attempt_number");
b.Property<DateTime?>("GradedAt")
@@ -584,6 +584,10 @@ namespace TechHelper.Server.Migrations
.HasColumnType("float")
.HasColumnName("points_awarded");
b.Property<int>("Status")
.HasColumnType("int")
.HasColumnName("status");
b.Property<string>("StudentAnswer")
.HasColumnType("longtext")
.HasColumnName("student_answer");
@@ -751,19 +755,19 @@ namespace TechHelper.Server.Migrations
b.HasData(
new
{
Id = new Guid("e3bff43c-36af-497a-971c-ed0a487bdd38"),
Id = new Guid("6d49bb08-97d6-4a38-88a7-8080925b589b"),
Name = "Student",
NormalizedName = "STUDENT"
},
new
{
Id = new Guid("f05c125e-e70f-40eb-9e19-6e69c3426849"),
Id = new Guid("e330c745-f422-43e3-bcdf-1439ace3c52f"),
Name = "Teacher",
NormalizedName = "TEACHER"
},
new
{
Id = new Guid("cf16c215-63f8-4962-8ad0-058274ecf944"),
Id = new Guid("379143a2-8d7f-4ef7-b7c0-14701b710f87"),
Name = "Administrator",
NormalizedName = "ADMINISTRATOR"
});