using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
///
public partial class JudgeRule : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "IsCalculatedJudge",
table: "VisitTask",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn(
name: "JudgeGenerateEnum",
table: "ReadingQuestionCriterionTrial",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn(
name: "JudgeModeEnum",
table: "ReadingQuestionCriterionTrial",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn(
name: "JudgeRuleEnum",
table: "ReadingQuestionCriterionTrial",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateTable(
name: "ReadingQuestionVisitJudgeRule",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
ReadingQuestionId = table.Column(type: "uniqueidentifier", nullable: false, comment: "问题Id"),
VisitNum = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false),
AnswerGroup = table.Column(type: "nvarchar(max)", nullable: false, comment: "答案分组"),
AnswerCombination = table.Column(type: "nvarchar(max)", nullable: false, comment: "答案组合"),
JudgeType = table.Column(type: "int", nullable: false, comment: "裁判类型"),
JudgeDifferenceValue = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true, comment: "裁判百分比或绝对值的相差值"),
JudgeDifferenceType = table.Column(type: "int", nullable: false, comment: "裁判百分比或绝对值的相差值匹配规则"),
CreateUserId = table.Column(type: "uniqueidentifier", nullable: false),
CreateTime = table.Column(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);
}
///
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");
}
}
}