实验排课再次修正
This commit is contained in:
+6655
File diff suppressed because it is too large
Load Diff
+81
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class SeparateExperimentClassroomScope : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "ExperimentRequiredBuildingId",
|
||||
table: "TeachingTaskScheduleConstraints",
|
||||
type: "char(36)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "ExperimentRequiredCampusId",
|
||||
table: "TeachingTaskScheduleConstraints",
|
||||
type: "char(36)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TeachingTaskScheduleConstraints_ExperimentRequiredBuildingId",
|
||||
table: "TeachingTaskScheduleConstraints",
|
||||
column: "ExperimentRequiredBuildingId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TeachingTaskScheduleConstraints_ExperimentRequiredCampusId",
|
||||
table: "TeachingTaskScheduleConstraints",
|
||||
column: "ExperimentRequiredCampusId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_TeachingTaskScheduleConstraints_Buildings_ExperimentRequired~",
|
||||
table: "TeachingTaskScheduleConstraints",
|
||||
column: "ExperimentRequiredBuildingId",
|
||||
principalTable: "Buildings",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_TeachingTaskScheduleConstraints_Campuses_ExperimentRequiredC~",
|
||||
table: "TeachingTaskScheduleConstraints",
|
||||
column: "ExperimentRequiredCampusId",
|
||||
principalTable: "Campuses",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_TeachingTaskScheduleConstraints_Buildings_ExperimentRequired~",
|
||||
table: "TeachingTaskScheduleConstraints");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_TeachingTaskScheduleConstraints_Campuses_ExperimentRequiredC~",
|
||||
table: "TeachingTaskScheduleConstraints");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_TeachingTaskScheduleConstraints_ExperimentRequiredBuildingId",
|
||||
table: "TeachingTaskScheduleConstraints");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_TeachingTaskScheduleConstraints_ExperimentRequiredCampusId",
|
||||
table: "TeachingTaskScheduleConstraints");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ExperimentRequiredBuildingId",
|
||||
table: "TeachingTaskScheduleConstraints");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ExperimentRequiredCampusId",
|
||||
table: "TeachingTaskScheduleConstraints");
|
||||
}
|
||||
}
|
||||
}
|
||||
+24
@@ -4272,6 +4272,12 @@ namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
b.Property<int?>("EarliestPeriod")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<Guid?>("ExperimentRequiredBuildingId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<Guid?>("ExperimentRequiredCampusId")
|
||||
.HasColumnType("char(36)");
|
||||
|
||||
b.Property<int?>("LatestPeriod")
|
||||
.HasColumnType("int");
|
||||
|
||||
@@ -4292,6 +4298,10 @@ namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("ExperimentRequiredBuildingId");
|
||||
|
||||
b.HasIndex("ExperimentRequiredCampusId");
|
||||
|
||||
b.HasIndex("RequiredBuildingId");
|
||||
|
||||
b.HasIndex("RequiredCampusId");
|
||||
@@ -6295,6 +6305,16 @@ namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
|
||||
modelBuilder.Entity("Jiaowu.Api.Domain.Academic.TeachingTaskScheduleConstraint", b =>
|
||||
{
|
||||
b.HasOne("Jiaowu.Api.Domain.Academic.Building", "ExperimentRequiredBuilding")
|
||||
.WithMany()
|
||||
.HasForeignKey("ExperimentRequiredBuildingId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("Jiaowu.Api.Domain.Academic.Campus", "ExperimentRequiredCampus")
|
||||
.WithMany()
|
||||
.HasForeignKey("ExperimentRequiredCampusId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("Jiaowu.Api.Domain.Academic.Building", "RequiredBuilding")
|
||||
.WithMany()
|
||||
.HasForeignKey("RequiredBuildingId")
|
||||
@@ -6311,6 +6331,10 @@ namespace Jiaowu.Api.Infrastructure.Persistence.Migrations.MySql
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("ExperimentRequiredBuilding");
|
||||
|
||||
b.Navigation("ExperimentRequiredCampus");
|
||||
|
||||
b.Navigation("RequiredBuilding");
|
||||
|
||||
b.Navigation("RequiredCampus");
|
||||
|
||||
Reference in New Issue
Block a user