实验课现在直接进入普通排课流程,不再要求先到实验排课模块逐个安排。
普通“添加排课”新增“理论课 / 实验课”类型。 自动排课会分别补足理论学时和实验学时。 实验课只能安排到实验室、实训室、机房、语音室等场地。 发布课表时分别校验理论、实验学时;任一未排足都不能发布。 普通课表及 Excel 导出会标注“实验课”。 历史排课保持不变,迁移后默认识别为理论课;后续新建或修订版本时再补充实验课。
This commit is contained in:
@@ -76,6 +76,8 @@ public sealed class DevelopmentSqliteMigrator(
|
||||
"20260728_40_experiment_grade_management";
|
||||
private const string AppUpdateReleasesMigration =
|
||||
"20260729_41_app_update_releases";
|
||||
private const string IntegratedExperimentSchedulingMigration =
|
||||
"20260802_42_integrated_experiment_scheduling";
|
||||
|
||||
public async Task MigrateAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
@@ -577,6 +579,20 @@ public sealed class DevelopmentSqliteMigrator(
|
||||
AppUpdateReleasesMigration,
|
||||
AppUpdateReleasesStatements,
|
||||
cancellationToken);
|
||||
var scheduleEntryKindExists = await db.Database
|
||||
.SqlQueryRaw<int>(
|
||||
"""
|
||||
SELECT COUNT(*) AS "Value"
|
||||
FROM pragma_table_info('ScheduleEntries')
|
||||
WHERE name = 'Kind'
|
||||
""")
|
||||
.AnyAsync(value => value > 0, cancellationToken);
|
||||
await ApplyMigrationAsync(
|
||||
IntegratedExperimentSchedulingMigration,
|
||||
scheduleEntryKindExists
|
||||
? []
|
||||
: IntegratedExperimentSchedulingStatements,
|
||||
cancellationToken);
|
||||
}
|
||||
|
||||
private async Task ApplyMigrationAsync(
|
||||
@@ -2714,4 +2730,12 @@ public sealed class DevelopmentSqliteMigrator(
|
||||
ON "ExperimentGradeItemScores" ("ExperimentGradeItemId");
|
||||
"""
|
||||
];
|
||||
|
||||
private static readonly string[] IntegratedExperimentSchedulingStatements =
|
||||
[
|
||||
"""
|
||||
ALTER TABLE "ScheduleEntries"
|
||||
ADD COLUMN "Kind" INTEGER NOT NULL DEFAULT 1;
|
||||
"""
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user