irc-netcore-api/IRaCIS.Core.Infra.EFCore/Migrations/20260811091811_JudgeRule.cs

96 lines
3.9 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class JudgeRule : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsCalculatedJudge",
table: "VisitTask",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>(
name: "JudgeGenerateEnum",
table: "ReadingQuestionCriterionTrial",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "JudgeModeEnum",
table: "ReadingQuestionCriterionTrial",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "JudgeRuleEnum",
table: "ReadingQuestionCriterionTrial",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateTable(
name: "ReadingQuestionVisitJudgeRule",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ReadingQuestionId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "问题Id"),
VisitNum = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false),
AnswerGroup = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "答案分组"),
AnswerCombination = table.Column<string>(type: "nvarchar(max)", nullable: false, comment: "答案组合"),
JudgeType = table.Column<int>(type: "int", nullable: false, comment: "裁判类型"),
JudgeDifferenceValue = table.Column<decimal>(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true, comment: "裁判百分比或绝对值的相差值"),
JudgeDifferenceType = table.Column<int>(type: "int", nullable: false, comment: "裁判百分比或绝对值的相差值匹配规则"),
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ReadingQuestionVisitJudgeRule", x => x.Id)
.Annotation("SqlServer:Clustered", false);
},
comment: "项目阅片访视裁判规则");
migrationBuilder.CreateIndex(
name: "IX_ReadingQuestionVisitJudgeRule_CreateTime",
table: "ReadingQuestionVisitJudgeRule",
column: "CreateTime")
.Annotation("SqlServer:Clustered", true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ReadingQuestionVisitJudgeRule");
migrationBuilder.DropColumn(
name: "IsCalculatedJudge",
table: "VisitTask");
migrationBuilder.DropColumn(
name: "JudgeGenerateEnum",
table: "ReadingQuestionCriterionTrial");
migrationBuilder.DropColumn(
name: "JudgeModeEnum",
table: "ReadingQuestionCriterionTrial");
migrationBuilder.DropColumn(
name: "JudgeRuleEnum",
table: "ReadingQuestionCriterionTrial");
}
}
}