其他类型考试

This commit is contained in:
2026-08-08 16:42:57 +08:00 Unverified
parent a1205c8ef7
commit c9163e1d2f
14 changed files with 13172 additions and 4 deletions
@@ -0,0 +1,97 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
{
/// <inheritdoc />
public partial class OtherExamResults : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "OtherExamBatches",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false),
Name = table.Column<string>(type: "varchar(150)", maxLength: 150, nullable: false),
Organizer = table.Column<string>(type: "varchar(150)", maxLength: 150, nullable: true),
ExamDate = table.Column<DateTime>(type: "date", nullable: false),
MetricKind = table.Column<int>(type: "int", nullable: false),
MaxScore = table.Column<decimal>(type: "decimal(8,2)", precision: 8, scale: 2, nullable: true),
LevelOptions = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true),
Status = table.Column<int>(type: "int", nullable: false),
PublicationCount = table.Column<int>(type: "int", nullable: false),
PublishedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OtherExamBatches", x => x.Id);
})
.Annotation("MySQL:Charset", "utf8mb4");
migrationBuilder.CreateTable(
name: "OtherExamResults",
columns: table => new
{
Id = table.Column<Guid>(type: "char(36)", nullable: false),
OtherExamBatchId = table.Column<Guid>(type: "char(36)", nullable: false),
StudentId = table.Column<Guid>(type: "char(36)", nullable: false),
AttemptNumber = table.Column<int>(type: "int", nullable: false),
Score = table.Column<decimal>(type: "decimal(8,2)", precision: 8, scale: 2, nullable: true),
Level = table.Column<string>(type: "varchar(50)", maxLength: 50, nullable: true),
IsPassed = table.Column<bool>(type: "tinyint(1)", nullable: true),
Notes = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true),
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_OtherExamResults", x => x.Id);
table.ForeignKey(
name: "FK_OtherExamResults_OtherExamBatches_OtherExamBatchId",
column: x => x.OtherExamBatchId,
principalTable: "OtherExamBatches",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_OtherExamResults_Students_StudentId",
column: x => x.StudentId,
principalTable: "Students",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
})
.Annotation("MySQL:Charset", "utf8mb4");
migrationBuilder.CreateIndex(
name: "IX_OtherExamBatches_Status_ExamDate",
table: "OtherExamBatches",
columns: new[] { "Status", "ExamDate" });
migrationBuilder.CreateIndex(
name: "IX_OtherExamResults_OtherExamBatchId_StudentId_AttemptNumber",
table: "OtherExamResults",
columns: new[] { "OtherExamBatchId", "StudentId", "AttemptNumber" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_OtherExamResults_StudentId_OtherExamBatchId",
table: "OtherExamResults",
columns: new[] { "StudentId", "OtherExamBatchId" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "OtherExamResults");
migrationBuilder.DropTable(
name: "OtherExamBatches");
}
}
}
@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
{
/// <inheritdoc />
public partial class OtherExamIdentityAndImport : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "ExamCode",
table: "OtherExamBatches",
type: "varchar(60)",
maxLength: 60,
nullable: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ExamCode",
table: "OtherExamBatches");
}
}
}
@@ -3278,6 +3278,107 @@ namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
b.ToTable("OfficialDocumentDownloads");
});
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.OtherExamBatch", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("ExamCode")
.HasMaxLength(60)
.HasColumnType("varchar(60)");
b.Property<DateTime>("ExamDate")
.HasColumnType("date");
b.Property<string>("LevelOptions")
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<decimal?>("MaxScore")
.HasPrecision(8, 2)
.HasColumnType("decimal(8,2)");
b.Property<int>("MetricKind")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(150)
.HasColumnType("varchar(150)");
b.Property<string>("Organizer")
.HasMaxLength(150)
.HasColumnType("varchar(150)");
b.Property<int>("PublicationCount")
.HasColumnType("int");
b.Property<DateTime?>("PublishedAt")
.HasColumnType("datetime(6)");
b.Property<int>("Status")
.HasColumnType("int");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("Status", "ExamDate");
b.ToTable("OtherExamBatches");
});
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.OtherExamResult", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<int>("AttemptNumber")
.HasColumnType("int");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<bool?>("IsPassed")
.HasColumnType("tinyint(1)");
b.Property<string>("Level")
.HasMaxLength(50)
.HasColumnType("varchar(50)");
b.Property<string>("Notes")
.HasMaxLength(500)
.HasColumnType("varchar(500)");
b.Property<Guid>("OtherExamBatchId")
.HasColumnType("char(36)");
b.Property<decimal?>("Score")
.HasPrecision(8, 2)
.HasColumnType("decimal(8,2)");
b.Property<Guid>("StudentId")
.HasColumnType("char(36)");
b.Property<DateTime>("UpdatedAt")
.HasColumnType("datetime(6)");
b.HasKey("Id");
b.HasIndex("StudentId", "OtherExamBatchId");
b.HasIndex("OtherExamBatchId", "StudentId", "AttemptNumber")
.IsUnique();
b.ToTable("OtherExamResults");
});
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ScheduleEntry", b =>
{
b.Property<Guid>("Id")
@@ -5598,6 +5699,25 @@ namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
b.Navigation("OfficialDocument");
});
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.OtherExamResult", b =>
{
b.HasOne("Jiaowu.Api.Domain.Academic.OtherExamBatch", "OtherExamBatch")
.WithMany("Results")
.HasForeignKey("OtherExamBatchId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
.WithMany()
.HasForeignKey("StudentId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("OtherExamBatch");
b.Navigation("Student");
});
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ScheduleEntry", b =>
{
b.HasOne("Jiaowu.Api.Domain.Academic.Classroom", "Classroom")
@@ -6095,6 +6215,11 @@ namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
b.Navigation("Downloads");
});
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.OtherExamBatch", b =>
{
b.Navigation("Results");
});
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.SchedulePlan", b =>
{
b.Navigation("Entries");