学籍异动:休学、复学、退学申请及辅导员→学院→教务处分级审批。
毕业审核:批次计算、缺失课程检查、人工复核、结果发布。 学位授予:毕业资格与 GPA 计算、人工调整、发布授予结果。 毕业离校:离校事项配置、责任角色分工、逐项办理及批次关闭。
This commit is contained in:
@@ -41,6 +41,18 @@ public sealed class AppDbContext(DbContextOptions<AppDbContext> options)
|
||||
Set<ExamSessionInvigilator>();
|
||||
public DbSet<StudentStatusChange> StudentStatusChanges =>
|
||||
Set<StudentStatusChange>();
|
||||
public DbSet<GraduationAuditBatch> GraduationAuditBatches =>
|
||||
Set<GraduationAuditBatch>();
|
||||
public DbSet<GraduationAuditResult> GraduationAuditResults =>
|
||||
Set<GraduationAuditResult>();
|
||||
public DbSet<DegreeAwardBatch> DegreeAwardBatches => Set<DegreeAwardBatch>();
|
||||
public DbSet<DegreeAwardResult> DegreeAwardResults => Set<DegreeAwardResult>();
|
||||
public DbSet<GraduationClearanceBatch> GraduationClearanceBatches =>
|
||||
Set<GraduationClearanceBatch>();
|
||||
public DbSet<GraduationClearanceItem> GraduationClearanceItems =>
|
||||
Set<GraduationClearanceItem>();
|
||||
public DbSet<GraduationClearanceRecord> GraduationClearanceRecords =>
|
||||
Set<GraduationClearanceRecord>();
|
||||
public DbSet<AuditLog> AuditLogs => Set<AuditLog>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
@@ -396,6 +408,82 @@ public sealed class AppDbContext(DbContextOptions<AppDbContext> options)
|
||||
entity.HasOne(x => x.Student).WithMany()
|
||||
.HasForeignKey(x => x.StudentId).OnDelete(DeleteBehavior.Restrict);
|
||||
});
|
||||
builder.Entity<GraduationAuditBatch>(entity =>
|
||||
{
|
||||
entity.Property(x => x.Name).HasMaxLength(120);
|
||||
entity.Property(x => x.Notes).HasMaxLength(500);
|
||||
entity.HasIndex(x => new { x.GraduationYear, x.EnrollmentYear });
|
||||
entity.HasIndex(x => x.Status);
|
||||
});
|
||||
builder.Entity<GraduationAuditResult>(entity =>
|
||||
{
|
||||
entity.Property(x => x.RequiredCredits).HasPrecision(6, 2);
|
||||
entity.Property(x => x.EarnedCredits).HasPrecision(6, 2);
|
||||
entity.Property(x => x.MissingCourseNames).HasMaxLength(2000);
|
||||
entity.Property(x => x.ReviewComment).HasMaxLength(500);
|
||||
entity.HasIndex(x => new { x.GraduationAuditBatchId, x.StudentId })
|
||||
.IsUnique();
|
||||
entity.HasIndex(x => new { x.Conclusion, x.IsOverridden });
|
||||
entity.HasOne(x => x.GraduationAuditBatch).WithMany(x => x.Results)
|
||||
.HasForeignKey(x => x.GraduationAuditBatchId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
entity.HasOne(x => x.Student).WithMany()
|
||||
.HasForeignKey(x => x.StudentId).OnDelete(DeleteBehavior.Restrict);
|
||||
entity.HasOne(x => x.CurriculumPlan).WithMany()
|
||||
.HasForeignKey(x => x.CurriculumPlanId).OnDelete(DeleteBehavior.SetNull);
|
||||
});
|
||||
builder.Entity<DegreeAwardBatch>(entity =>
|
||||
{
|
||||
entity.Property(x => x.Name).HasMaxLength(120);
|
||||
entity.Property(x => x.DegreeName).HasMaxLength(80);
|
||||
entity.Property(x => x.MinimumGradePoint).HasPrecision(3, 2);
|
||||
entity.Property(x => x.Notes).HasMaxLength(500);
|
||||
entity.HasIndex(x => new { x.GraduationYear, x.Status });
|
||||
});
|
||||
builder.Entity<DegreeAwardResult>(entity =>
|
||||
{
|
||||
entity.Property(x => x.AverageGradePoint).HasPrecision(4, 2);
|
||||
entity.Property(x => x.ExceptionReason).HasMaxLength(500);
|
||||
entity.Property(x => x.ReviewComment).HasMaxLength(500);
|
||||
entity.HasIndex(x => new { x.DegreeAwardBatchId, x.StudentId }).IsUnique();
|
||||
entity.HasIndex(x => new { x.Conclusion, x.IsOverridden });
|
||||
entity.HasOne(x => x.DegreeAwardBatch).WithMany(x => x.Results)
|
||||
.HasForeignKey(x => x.DegreeAwardBatchId).OnDelete(DeleteBehavior.Cascade);
|
||||
entity.HasOne(x => x.Student).WithMany()
|
||||
.HasForeignKey(x => x.StudentId).OnDelete(DeleteBehavior.Restrict);
|
||||
entity.HasOne(x => x.GraduationAuditResult).WithMany()
|
||||
.HasForeignKey(x => x.GraduationAuditResultId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
});
|
||||
builder.Entity<GraduationClearanceBatch>(entity =>
|
||||
{
|
||||
entity.Property(x => x.Name).HasMaxLength(120);
|
||||
entity.Property(x => x.Notes).HasMaxLength(500);
|
||||
entity.HasIndex(x => new { x.GraduationYear, x.Status });
|
||||
});
|
||||
builder.Entity<GraduationClearanceItem>(entity =>
|
||||
{
|
||||
entity.Property(x => x.Code).HasMaxLength(30);
|
||||
entity.Property(x => x.Name).HasMaxLength(100);
|
||||
entity.Property(x => x.ResponsibleUnit).HasMaxLength(100);
|
||||
entity.Property(x => x.ResponsibleRole).HasMaxLength(30);
|
||||
entity.HasIndex(x => new { x.GraduationClearanceBatchId, x.Code }).IsUnique();
|
||||
entity.HasOne(x => x.GraduationClearanceBatch).WithMany(x => x.Items)
|
||||
.HasForeignKey(x => x.GraduationClearanceBatchId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
});
|
||||
builder.Entity<GraduationClearanceRecord>(entity =>
|
||||
{
|
||||
entity.Property(x => x.Notes).HasMaxLength(500);
|
||||
entity.HasIndex(x => new { x.GraduationClearanceItemId, x.StudentId })
|
||||
.IsUnique();
|
||||
entity.HasIndex(x => new { x.StudentId, x.Status });
|
||||
entity.HasOne(x => x.GraduationClearanceItem).WithMany(x => x.Records)
|
||||
.HasForeignKey(x => x.GraduationClearanceItemId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
entity.HasOne(x => x.Student).WithMany()
|
||||
.HasForeignKey(x => x.StudentId).OnDelete(DeleteBehavior.Restrict);
|
||||
});
|
||||
|
||||
builder.Entity<AuditLog>(entity =>
|
||||
{
|
||||
|
||||
@@ -15,6 +15,9 @@ public sealed class DevelopmentSqliteMigrator(
|
||||
private const string GradesMigration = "20260724_07_grades";
|
||||
private const string ExamsMigration = "20260724_08_exams";
|
||||
private const string StudentStatusChangesMigration = "20260724_09_student_status_changes";
|
||||
private const string GraduationAuditsMigration = "20260724_10_graduation_audits";
|
||||
private const string DegreeAwardsMigration = "20260724_11_degree_awards";
|
||||
private const string GraduationClearanceMigration = "20260724_12_graduation_clearance";
|
||||
|
||||
public async Task MigrateAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
@@ -75,6 +78,18 @@ public sealed class DevelopmentSqliteMigrator(
|
||||
StudentStatusChangesMigration,
|
||||
StudentStatusChangesStatements,
|
||||
cancellationToken);
|
||||
await ApplyMigrationAsync(
|
||||
GraduationAuditsMigration,
|
||||
GraduationAuditsStatements,
|
||||
cancellationToken);
|
||||
await ApplyMigrationAsync(
|
||||
DegreeAwardsMigration,
|
||||
DegreeAwardsStatements,
|
||||
cancellationToken);
|
||||
await ApplyMigrationAsync(
|
||||
GraduationClearanceMigration,
|
||||
GraduationClearanceStatements,
|
||||
cancellationToken);
|
||||
}
|
||||
|
||||
private async Task ApplyMigrationAsync(
|
||||
@@ -637,4 +652,119 @@ public sealed class DevelopmentSqliteMigrator(
|
||||
""",
|
||||
"""CREATE INDEX IF NOT EXISTS "IX_StudentStatusChanges_StudentId_State" ON "StudentStatusChanges" ("StudentId", "State");"""
|
||||
];
|
||||
|
||||
private static readonly string[] GraduationAuditsStatements =
|
||||
[
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS "GraduationAuditBatches" (
|
||||
"Id" TEXT NOT NULL CONSTRAINT "PK_GraduationAuditBatches" PRIMARY KEY,
|
||||
"Name" TEXT NOT NULL, "GraduationYear" INTEGER NOT NULL,
|
||||
"EnrollmentYear" INTEGER NOT NULL, "Status" INTEGER NOT NULL,
|
||||
"Notes" TEXT NULL, "CalculatedAt" TEXT NULL, "PublishedAt" TEXT NULL,
|
||||
"CreatedAt" TEXT NOT NULL, "UpdatedAt" TEXT NOT NULL
|
||||
);
|
||||
""",
|
||||
"""CREATE INDEX IF NOT EXISTS "IX_GraduationAuditBatches_GraduationYear_EnrollmentYear" ON "GraduationAuditBatches" ("GraduationYear", "EnrollmentYear");""",
|
||||
"""CREATE INDEX IF NOT EXISTS "IX_GraduationAuditBatches_Status" ON "GraduationAuditBatches" ("Status");""",
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS "GraduationAuditResults" (
|
||||
"Id" TEXT NOT NULL CONSTRAINT "PK_GraduationAuditResults" PRIMARY KEY,
|
||||
"GraduationAuditBatchId" TEXT NOT NULL, "StudentId" TEXT NOT NULL,
|
||||
"CurriculumPlanId" TEXT NULL, "StudentStatusSnapshot" INTEGER NOT NULL,
|
||||
"RequiredCredits" TEXT NOT NULL, "EarnedCredits" TEXT NOT NULL,
|
||||
"RequiredCourseCount" INTEGER NOT NULL,
|
||||
"PassedRequiredCourseCount" INTEGER NOT NULL,
|
||||
"FailedCourseCount" INTEGER NOT NULL,
|
||||
"MissingCourseNames" TEXT NOT NULL,
|
||||
"CalculatedConclusion" INTEGER NOT NULL, "Conclusion" INTEGER NOT NULL,
|
||||
"IsOverridden" INTEGER NOT NULL, "ReviewComment" TEXT NULL,
|
||||
"ReviewedAt" TEXT NULL, "CreatedAt" TEXT NOT NULL, "UpdatedAt" TEXT NOT NULL,
|
||||
CONSTRAINT "FK_GraduationAuditResults_GraduationAuditBatches_GraduationAuditBatchId"
|
||||
FOREIGN KEY ("GraduationAuditBatchId") REFERENCES "GraduationAuditBatches" ("Id") ON DELETE CASCADE,
|
||||
CONSTRAINT "FK_GraduationAuditResults_Students_StudentId"
|
||||
FOREIGN KEY ("StudentId") REFERENCES "Students" ("Id") ON DELETE RESTRICT,
|
||||
CONSTRAINT "FK_GraduationAuditResults_CurriculumPlans_CurriculumPlanId"
|
||||
FOREIGN KEY ("CurriculumPlanId") REFERENCES "CurriculumPlans" ("Id") ON DELETE SET NULL
|
||||
);
|
||||
""",
|
||||
"""CREATE UNIQUE INDEX IF NOT EXISTS "IX_GraduationAuditResults_GraduationAuditBatchId_StudentId" ON "GraduationAuditResults" ("GraduationAuditBatchId", "StudentId");""",
|
||||
"""CREATE INDEX IF NOT EXISTS "IX_GraduationAuditResults_StudentId" ON "GraduationAuditResults" ("StudentId");""",
|
||||
"""CREATE INDEX IF NOT EXISTS "IX_GraduationAuditResults_CurriculumPlanId" ON "GraduationAuditResults" ("CurriculumPlanId");""",
|
||||
"""CREATE INDEX IF NOT EXISTS "IX_GraduationAuditResults_Conclusion_IsOverridden" ON "GraduationAuditResults" ("Conclusion", "IsOverridden");"""
|
||||
];
|
||||
|
||||
private static readonly string[] DegreeAwardsStatements =
|
||||
[
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS "DegreeAwardBatches" (
|
||||
"Id" TEXT NOT NULL CONSTRAINT "PK_DegreeAwardBatches" PRIMARY KEY,
|
||||
"Name" TEXT NOT NULL, "GraduationYear" INTEGER NOT NULL,
|
||||
"DegreeName" TEXT NOT NULL, "MinimumGradePoint" TEXT NOT NULL,
|
||||
"Status" INTEGER NOT NULL, "Notes" TEXT NULL,
|
||||
"CalculatedAt" TEXT NULL, "PublishedAt" TEXT NULL,
|
||||
"CreatedAt" TEXT NOT NULL, "UpdatedAt" TEXT NOT NULL
|
||||
);
|
||||
""",
|
||||
"""CREATE INDEX IF NOT EXISTS "IX_DegreeAwardBatches_GraduationYear_Status" ON "DegreeAwardBatches" ("GraduationYear", "Status");""",
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS "DegreeAwardResults" (
|
||||
"Id" TEXT NOT NULL CONSTRAINT "PK_DegreeAwardResults" PRIMARY KEY,
|
||||
"DegreeAwardBatchId" TEXT NOT NULL, "StudentId" TEXT NOT NULL,
|
||||
"GraduationAuditResultId" TEXT NOT NULL, "AverageGradePoint" TEXT NOT NULL,
|
||||
"CalculatedConclusion" INTEGER NOT NULL, "Conclusion" INTEGER NOT NULL,
|
||||
"ExceptionReason" TEXT NOT NULL, "IsOverridden" INTEGER NOT NULL,
|
||||
"ReviewComment" TEXT NULL, "ReviewedAt" TEXT NULL,
|
||||
"CreatedAt" TEXT NOT NULL, "UpdatedAt" TEXT NOT NULL,
|
||||
CONSTRAINT "FK_DegreeAwardResults_DegreeAwardBatches_DegreeAwardBatchId"
|
||||
FOREIGN KEY ("DegreeAwardBatchId") REFERENCES "DegreeAwardBatches" ("Id") ON DELETE CASCADE,
|
||||
CONSTRAINT "FK_DegreeAwardResults_Students_StudentId"
|
||||
FOREIGN KEY ("StudentId") REFERENCES "Students" ("Id") ON DELETE RESTRICT,
|
||||
CONSTRAINT "FK_DegreeAwardResults_GraduationAuditResults_GraduationAuditResultId"
|
||||
FOREIGN KEY ("GraduationAuditResultId") REFERENCES "GraduationAuditResults" ("Id") ON DELETE RESTRICT
|
||||
);
|
||||
""",
|
||||
"""CREATE UNIQUE INDEX IF NOT EXISTS "IX_DegreeAwardResults_DegreeAwardBatchId_StudentId" ON "DegreeAwardResults" ("DegreeAwardBatchId", "StudentId");""",
|
||||
"""CREATE INDEX IF NOT EXISTS "IX_DegreeAwardResults_StudentId" ON "DegreeAwardResults" ("StudentId");""",
|
||||
"""CREATE INDEX IF NOT EXISTS "IX_DegreeAwardResults_GraduationAuditResultId" ON "DegreeAwardResults" ("GraduationAuditResultId");""",
|
||||
"""CREATE INDEX IF NOT EXISTS "IX_DegreeAwardResults_Conclusion_IsOverridden" ON "DegreeAwardResults" ("Conclusion", "IsOverridden");"""
|
||||
];
|
||||
|
||||
private static readonly string[] GraduationClearanceStatements =
|
||||
[
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS "GraduationClearanceBatches" (
|
||||
"Id" TEXT NOT NULL CONSTRAINT "PK_GraduationClearanceBatches" PRIMARY KEY,
|
||||
"Name" TEXT NOT NULL, "GraduationYear" INTEGER NOT NULL,
|
||||
"Status" INTEGER NOT NULL, "Notes" TEXT NULL, "ClosedAt" TEXT NULL,
|
||||
"CreatedAt" TEXT NOT NULL, "UpdatedAt" TEXT NOT NULL
|
||||
);
|
||||
""",
|
||||
"""CREATE INDEX IF NOT EXISTS "IX_GraduationClearanceBatches_GraduationYear_Status" ON "GraduationClearanceBatches" ("GraduationYear", "Status");""",
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS "GraduationClearanceItems" (
|
||||
"Id" TEXT NOT NULL CONSTRAINT "PK_GraduationClearanceItems" PRIMARY KEY,
|
||||
"GraduationClearanceBatchId" TEXT NOT NULL, "Code" TEXT NOT NULL,
|
||||
"Name" TEXT NOT NULL, "ResponsibleUnit" TEXT NOT NULL,
|
||||
"ResponsibleRole" TEXT NOT NULL, "IsRequired" INTEGER NOT NULL,
|
||||
"SortOrder" INTEGER NOT NULL, "CreatedAt" TEXT NOT NULL, "UpdatedAt" TEXT NOT NULL,
|
||||
CONSTRAINT "FK_GraduationClearanceItems_GraduationClearanceBatches_GraduationClearanceBatchId"
|
||||
FOREIGN KEY ("GraduationClearanceBatchId") REFERENCES "GraduationClearanceBatches" ("Id") ON DELETE CASCADE
|
||||
);
|
||||
""",
|
||||
"""CREATE UNIQUE INDEX IF NOT EXISTS "IX_GraduationClearanceItems_GraduationClearanceBatchId_Code" ON "GraduationClearanceItems" ("GraduationClearanceBatchId", "Code");""",
|
||||
"""
|
||||
CREATE TABLE IF NOT EXISTS "GraduationClearanceRecords" (
|
||||
"Id" TEXT NOT NULL CONSTRAINT "PK_GraduationClearanceRecords" PRIMARY KEY,
|
||||
"GraduationClearanceItemId" TEXT NOT NULL, "StudentId" TEXT NOT NULL,
|
||||
"Status" INTEGER NOT NULL, "Notes" TEXT NULL, "CompletedAt" TEXT NULL,
|
||||
"CompletedByUserId" TEXT NULL, "CreatedAt" TEXT NOT NULL, "UpdatedAt" TEXT NOT NULL,
|
||||
CONSTRAINT "FK_GraduationClearanceRecords_GraduationClearanceItems_GraduationClearanceItemId"
|
||||
FOREIGN KEY ("GraduationClearanceItemId") REFERENCES "GraduationClearanceItems" ("Id") ON DELETE CASCADE,
|
||||
CONSTRAINT "FK_GraduationClearanceRecords_Students_StudentId"
|
||||
FOREIGN KEY ("StudentId") REFERENCES "Students" ("Id") ON DELETE RESTRICT
|
||||
);
|
||||
""",
|
||||
"""CREATE UNIQUE INDEX IF NOT EXISTS "IX_GraduationClearanceRecords_GraduationClearanceItemId_StudentId" ON "GraduationClearanceRecords" ("GraduationClearanceItemId", "StudentId");""",
|
||||
"""CREATE INDEX IF NOT EXISTS "IX_GraduationClearanceRecords_StudentId_Status" ON "GraduationClearanceRecords" ("StudentId", "Status");"""
|
||||
];
|
||||
}
|
||||
|
||||
+2183
File diff suppressed because it is too large
Load Diff
+124
@@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class GraduationAudits : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GraduationAuditBatches",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
Name = table.Column<string>(type: "varchar(120)", maxLength: 120, nullable: false),
|
||||
GraduationYear = table.Column<int>(type: "int", nullable: false),
|
||||
EnrollmentYear = table.Column<int>(type: "int", nullable: false),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
Notes = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true),
|
||||
CalculatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
||||
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_GraduationAuditBatches", x => x.Id);
|
||||
})
|
||||
.Annotation("MySQL:Charset", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GraduationAuditResults",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
GraduationAuditBatchId = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
StudentId = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
CurriculumPlanId = table.Column<Guid>(type: "char(36)", nullable: true),
|
||||
StudentStatusSnapshot = table.Column<int>(type: "int", nullable: false),
|
||||
RequiredCredits = table.Column<decimal>(type: "decimal(6,2)", precision: 6, scale: 2, nullable: false),
|
||||
EarnedCredits = table.Column<decimal>(type: "decimal(6,2)", precision: 6, scale: 2, nullable: false),
|
||||
RequiredCourseCount = table.Column<int>(type: "int", nullable: false),
|
||||
PassedRequiredCourseCount = table.Column<int>(type: "int", nullable: false),
|
||||
FailedCourseCount = table.Column<int>(type: "int", nullable: false),
|
||||
MissingCourseNames = table.Column<string>(type: "varchar(2000)", maxLength: 2000, nullable: false),
|
||||
CalculatedConclusion = table.Column<int>(type: "int", nullable: false),
|
||||
Conclusion = table.Column<int>(type: "int", nullable: false),
|
||||
IsOverridden = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
ReviewComment = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true),
|
||||
ReviewedAt = 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_GraduationAuditResults", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_GraduationAuditResults_CurriculumPlans_CurriculumPlanId",
|
||||
column: x => x.CurriculumPlanId,
|
||||
principalTable: "CurriculumPlans",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
table.ForeignKey(
|
||||
name: "FK_GraduationAuditResults_GraduationAuditBatches_GraduationAudi~",
|
||||
column: x => x.GraduationAuditBatchId,
|
||||
principalTable: "GraduationAuditBatches",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_GraduationAuditResults_Students_StudentId",
|
||||
column: x => x.StudentId,
|
||||
principalTable: "Students",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
})
|
||||
.Annotation("MySQL:Charset", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GraduationAuditBatches_GraduationYear_EnrollmentYear",
|
||||
table: "GraduationAuditBatches",
|
||||
columns: new[] { "GraduationYear", "EnrollmentYear" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GraduationAuditBatches_Status",
|
||||
table: "GraduationAuditBatches",
|
||||
column: "Status");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GraduationAuditResults_Conclusion_IsOverridden",
|
||||
table: "GraduationAuditResults",
|
||||
columns: new[] { "Conclusion", "IsOverridden" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GraduationAuditResults_CurriculumPlanId",
|
||||
table: "GraduationAuditResults",
|
||||
column: "CurriculumPlanId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GraduationAuditResults_GraduationAuditBatchId_StudentId",
|
||||
table: "GraduationAuditResults",
|
||||
columns: new[] { "GraduationAuditBatchId", "StudentId" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GraduationAuditResults_StudentId",
|
||||
table: "GraduationAuditResults",
|
||||
column: "StudentId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "GraduationAuditResults");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "GraduationAuditBatches");
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+2324
File diff suppressed because it is too large
Load Diff
+115
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class DegreeAwards : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DegreeAwardBatches",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
Name = table.Column<string>(type: "varchar(120)", maxLength: 120, nullable: false),
|
||||
GraduationYear = table.Column<int>(type: "int", nullable: false),
|
||||
DegreeName = table.Column<string>(type: "varchar(80)", maxLength: 80, nullable: false),
|
||||
MinimumGradePoint = table.Column<decimal>(type: "decimal(3,2)", precision: 3, scale: 2, nullable: false),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
Notes = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true),
|
||||
CalculatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
||||
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_DegreeAwardBatches", x => x.Id);
|
||||
})
|
||||
.Annotation("MySQL:Charset", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DegreeAwardResults",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
DegreeAwardBatchId = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
StudentId = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
GraduationAuditResultId = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
AverageGradePoint = table.Column<decimal>(type: "decimal(4,2)", precision: 4, scale: 2, nullable: false),
|
||||
CalculatedConclusion = table.Column<int>(type: "int", nullable: false),
|
||||
Conclusion = table.Column<int>(type: "int", nullable: false),
|
||||
ExceptionReason = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: false),
|
||||
IsOverridden = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
ReviewComment = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true),
|
||||
ReviewedAt = 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_DegreeAwardResults", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DegreeAwardResults_DegreeAwardBatches_DegreeAwardBatchId",
|
||||
column: x => x.DegreeAwardBatchId,
|
||||
principalTable: "DegreeAwardBatches",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DegreeAwardResults_GraduationAuditResults_GraduationAuditRes~",
|
||||
column: x => x.GraduationAuditResultId,
|
||||
principalTable: "GraduationAuditResults",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_DegreeAwardResults_Students_StudentId",
|
||||
column: x => x.StudentId,
|
||||
principalTable: "Students",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
})
|
||||
.Annotation("MySQL:Charset", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DegreeAwardBatches_GraduationYear_Status",
|
||||
table: "DegreeAwardBatches",
|
||||
columns: new[] { "GraduationYear", "Status" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DegreeAwardResults_Conclusion_IsOverridden",
|
||||
table: "DegreeAwardResults",
|
||||
columns: new[] { "Conclusion", "IsOverridden" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DegreeAwardResults_DegreeAwardBatchId_StudentId",
|
||||
table: "DegreeAwardResults",
|
||||
columns: new[] { "DegreeAwardBatchId", "StudentId" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DegreeAwardResults_GraduationAuditResultId",
|
||||
table: "DegreeAwardResults",
|
||||
column: "GraduationAuditResultId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DegreeAwardResults_StudentId",
|
||||
table: "DegreeAwardResults",
|
||||
column: "StudentId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "DegreeAwardResults");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DegreeAwardBatches");
|
||||
}
|
||||
}
|
||||
}
|
||||
+2491
File diff suppressed because it is too large
Load Diff
+128
@@ -0,0 +1,128 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class GraduationClearance : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GraduationClearanceBatches",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
Name = table.Column<string>(type: "varchar(120)", maxLength: 120, nullable: false),
|
||||
GraduationYear = table.Column<int>(type: "int", nullable: false),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
Notes = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true),
|
||||
ClosedAt = 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_GraduationClearanceBatches", x => x.Id);
|
||||
})
|
||||
.Annotation("MySQL:Charset", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GraduationClearanceItems",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
GraduationClearanceBatchId = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
Code = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: false),
|
||||
Name = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false),
|
||||
ResponsibleUnit = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false),
|
||||
ResponsibleRole = table.Column<string>(type: "varchar(30)", maxLength: 30, nullable: false),
|
||||
IsRequired = table.Column<bool>(type: "tinyint(1)", nullable: false),
|
||||
SortOrder = table.Column<int>(type: "int", nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false),
|
||||
UpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_GraduationClearanceItems", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_GraduationClearanceItems_GraduationClearanceBatches_Graduati~",
|
||||
column: x => x.GraduationClearanceBatchId,
|
||||
principalTable: "GraduationClearanceBatches",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySQL:Charset", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GraduationClearanceRecords",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
GraduationClearanceItemId = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
StudentId = table.Column<Guid>(type: "char(36)", nullable: false),
|
||||
Status = table.Column<int>(type: "int", nullable: false),
|
||||
Notes = table.Column<string>(type: "varchar(500)", maxLength: 500, nullable: true),
|
||||
CompletedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true),
|
||||
CompletedByUserId = table.Column<Guid>(type: "char(36)", 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_GraduationClearanceRecords", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_GraduationClearanceRecords_GraduationClearanceItems_Graduati~",
|
||||
column: x => x.GraduationClearanceItemId,
|
||||
principalTable: "GraduationClearanceItems",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_GraduationClearanceRecords_Students_StudentId",
|
||||
column: x => x.StudentId,
|
||||
principalTable: "Students",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
})
|
||||
.Annotation("MySQL:Charset", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GraduationClearanceBatches_GraduationYear_Status",
|
||||
table: "GraduationClearanceBatches",
|
||||
columns: new[] { "GraduationYear", "Status" });
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GraduationClearanceItems_GraduationClearanceBatchId_Code",
|
||||
table: "GraduationClearanceItems",
|
||||
columns: new[] { "GraduationClearanceBatchId", "Code" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GraduationClearanceRecords_GraduationClearanceItemId_Student~",
|
||||
table: "GraduationClearanceRecords",
|
||||
columns: new[] { "GraduationClearanceItemId", "StudentId" },
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_GraduationClearanceRecords_StudentId_Status",
|
||||
table: "GraduationClearanceRecords",
|
||||
columns: new[] { "StudentId", "Status" });
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "GraduationClearanceRecords");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "GraduationClearanceItems");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "GraduationClearanceBatches");
|
||||
}
|
||||
}
|
||||
}
|
||||
+460
@@ -634,6 +634,115 @@ namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
b.ToTable("CurriculumPlans");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.DegreeAwardBatch", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTime?>("CalculatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<string>("DegreeName")
|
||||
.IsRequired()
|
||||
.HasMaxLength(80)
|
||||
.HasColumnType("varchar(80)");
|
||||
|
||||
b.Property<int>("GraduationYear")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<decimal>("MinimumGradePoint")
|
||||
.HasPrecision(3, 2)
|
||||
.HasColumnType("decimal(3,2)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(120)
|
||||
.HasColumnType("varchar(120)");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("varchar(500)");
|
||||
|
||||
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("GraduationYear", "Status");
|
||||
|
||||
b.ToTable("DegreeAwardBatches");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.DegreeAwardResult", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<decimal>("AverageGradePoint")
|
||||
.HasPrecision(4, 2)
|
||||
.HasColumnType("decimal(4,2)");
|
||||
|
||||
b.Property<int>("CalculatedConclusion")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Conclusion")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<Guid>("DegreeAwardBatchId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("ExceptionReason")
|
||||
.IsRequired()
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("varchar(500)");
|
||||
|
||||
b.Property<Guid>("GraduationAuditResultId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<bool>("IsOverridden")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("ReviewComment")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("varchar(500)");
|
||||
|
||||
b.Property<DateTime?>("ReviewedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<Guid>("StudentId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GraduationAuditResultId");
|
||||
|
||||
b.HasIndex("StudentId");
|
||||
|
||||
b.HasIndex("Conclusion", "IsOverridden");
|
||||
|
||||
b.HasIndex("DegreeAwardBatchId", "StudentId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DegreeAwardResults");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamPlan", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -836,6 +945,254 @@ namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
b.ToTable("GradeSheets");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationAuditBatch", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTime?>("CalculatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<int>("EnrollmentYear")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("GraduationYear")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(120)
|
||||
.HasColumnType("varchar(120)");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("varchar(500)");
|
||||
|
||||
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");
|
||||
|
||||
b.HasIndex("GraduationYear", "EnrollmentYear");
|
||||
|
||||
b.ToTable("GraduationAuditBatches");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationAuditResult", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<int>("CalculatedConclusion")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("Conclusion")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<Guid?>("CurriculumPlanId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<decimal>("EarnedCredits")
|
||||
.HasPrecision(6, 2)
|
||||
.HasColumnType("decimal(6,2)");
|
||||
|
||||
b.Property<int>("FailedCourseCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid>("GraduationAuditBatchId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<bool>("IsOverridden")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("MissingCourseNames")
|
||||
.IsRequired()
|
||||
.HasMaxLength(2000)
|
||||
.HasColumnType("varchar(2000)");
|
||||
|
||||
b.Property<int>("PassedRequiredCourseCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("RequiredCourseCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<decimal>("RequiredCredits")
|
||||
.HasPrecision(6, 2)
|
||||
.HasColumnType("decimal(6,2)");
|
||||
|
||||
b.Property<string>("ReviewComment")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("varchar(500)");
|
||||
|
||||
b.Property<DateTime?>("ReviewedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<Guid>("StudentId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<int>("StudentStatusSnapshot")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CurriculumPlanId");
|
||||
|
||||
b.HasIndex("StudentId");
|
||||
|
||||
b.HasIndex("Conclusion", "IsOverridden");
|
||||
|
||||
b.HasIndex("GraduationAuditBatchId", "StudentId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("GraduationAuditResults");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationClearanceBatch", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTime?>("ClosedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<int>("GraduationYear")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(120)
|
||||
.HasColumnType("varchar(120)");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("varchar(500)");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GraduationYear", "Status");
|
||||
|
||||
b.ToTable("GraduationClearanceBatches");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationClearanceItem", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Code")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("varchar(30)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<Guid>("GraduationClearanceBatchId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<bool>("IsRequired")
|
||||
.HasColumnType("tinyint(1)");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<string>("ResponsibleRole")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("varchar(30)");
|
||||
|
||||
b.Property<string>("ResponsibleUnit")
|
||||
.IsRequired()
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("varchar(100)");
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GraduationClearanceBatchId", "Code")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("GraduationClearanceItems");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationClearanceRecord", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTime?>("CompletedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<Guid?>("CompletedByUserId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTime>("CreatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.Property<Guid>("GraduationClearanceItemId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<string>("Notes")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("varchar(500)");
|
||||
|
||||
b.Property<int>("Status")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid>("StudentId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<DateTime>("UpdatedAt")
|
||||
.HasColumnType("datetime(6)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("GraduationClearanceItemId", "StudentId")
|
||||
.IsUnique();
|
||||
|
||||
b.HasIndex("StudentId", "Status");
|
||||
|
||||
b.ToTable("GraduationClearanceRecords");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Major", b =>
|
||||
{
|
||||
b.Property<Guid>("Id")
|
||||
@@ -1684,6 +2041,33 @@ namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
b.Navigation("Major");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.DegreeAwardResult", b =>
|
||||
{
|
||||
b.HasOne("Jiaowu.Api.Domain.Academic.DegreeAwardBatch", "DegreeAwardBatch")
|
||||
.WithMany("Results")
|
||||
.HasForeignKey("DegreeAwardBatchId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Jiaowu.Api.Domain.Academic.GraduationAuditResult", "GraduationAuditResult")
|
||||
.WithMany()
|
||||
.HasForeignKey("GraduationAuditResultId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
|
||||
.WithMany()
|
||||
.HasForeignKey("StudentId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("DegreeAwardBatch");
|
||||
|
||||
b.Navigation("GraduationAuditResult");
|
||||
|
||||
b.Navigation("Student");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamPlan", b =>
|
||||
{
|
||||
b.HasOne("Jiaowu.Api.Domain.Academic.AcademicTerm", "AcademicTerm")
|
||||
@@ -1771,6 +2155,62 @@ namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
b.Navigation("TeachingTask");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationAuditResult", b =>
|
||||
{
|
||||
b.HasOne("Jiaowu.Api.Domain.Academic.CurriculumPlan", "CurriculumPlan")
|
||||
.WithMany()
|
||||
.HasForeignKey("CurriculumPlanId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("Jiaowu.Api.Domain.Academic.GraduationAuditBatch", "GraduationAuditBatch")
|
||||
.WithMany("Results")
|
||||
.HasForeignKey("GraduationAuditBatchId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
|
||||
.WithMany()
|
||||
.HasForeignKey("StudentId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("CurriculumPlan");
|
||||
|
||||
b.Navigation("GraduationAuditBatch");
|
||||
|
||||
b.Navigation("Student");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationClearanceItem", b =>
|
||||
{
|
||||
b.HasOne("Jiaowu.Api.Domain.Academic.GraduationClearanceBatch", "GraduationClearanceBatch")
|
||||
.WithMany("Items")
|
||||
.HasForeignKey("GraduationClearanceBatchId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("GraduationClearanceBatch");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationClearanceRecord", b =>
|
||||
{
|
||||
b.HasOne("Jiaowu.Api.Domain.Academic.GraduationClearanceItem", "GraduationClearanceItem")
|
||||
.WithMany("Records")
|
||||
.HasForeignKey("GraduationClearanceItemId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Jiaowu.Api.Domain.Academic.Student", "Student")
|
||||
.WithMany()
|
||||
.HasForeignKey("StudentId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("GraduationClearanceItem");
|
||||
|
||||
b.Navigation("Student");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.Major", b =>
|
||||
{
|
||||
b.HasOne("Jiaowu.Api.Domain.Academic.College", "College")
|
||||
@@ -1996,6 +2436,11 @@ namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
b.Navigation("Modules");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.DegreeAwardBatch", b =>
|
||||
{
|
||||
b.Navigation("Results");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.ExamPlan", b =>
|
||||
{
|
||||
b.Navigation("Sessions");
|
||||
@@ -2011,6 +2456,21 @@ namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
b.Navigation("Records");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationAuditBatch", b =>
|
||||
{
|
||||
b.Navigation("Results");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationClearanceBatch", b =>
|
||||
{
|
||||
b.Navigation("Items");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.GraduationClearanceItem", b =>
|
||||
{
|
||||
b.Navigation("Records");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.SchedulePlan", b =>
|
||||
{
|
||||
b.Navigation("Entries");
|
||||
|
||||
Reference in New Issue
Block a user