104 lines
3.7 KiB
C#
104 lines
3.7 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class subjectQuit : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_ReadingTaskQuestionMark_ReadingQuestionTrial_QuestionId",
|
|
table: "ReadingTaskQuestionMark");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "CriterionTypeEnum",
|
|
table: "EmailNoticeConfig");
|
|
|
|
migrationBuilder.AlterColumn<Guid>(
|
|
name: "TrialReadingCriterionId",
|
|
table: "TrialEmailNoticeConfig",
|
|
type: "uniqueidentifier",
|
|
nullable: true,
|
|
comment: "下次版本删除",
|
|
oldClrType: typeof(Guid),
|
|
oldType: "uniqueidentifier",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "IsSubjectQuit",
|
|
table: "Subject",
|
|
type: "bit",
|
|
nullable: false,
|
|
defaultValue: false,
|
|
comment: "受试者退出");
|
|
|
|
migrationBuilder.AlterColumn<Guid>(
|
|
name: "QuestionId",
|
|
table: "ReadingTaskQuestionMark",
|
|
type: "uniqueidentifier",
|
|
nullable: true,
|
|
oldClrType: typeof(Guid),
|
|
oldType: "uniqueidentifier");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_ReadingTaskQuestionMark_ReadingQuestionTrial_QuestionId",
|
|
table: "ReadingTaskQuestionMark",
|
|
column: "QuestionId",
|
|
principalTable: "ReadingQuestionTrial",
|
|
principalColumn: "Id");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_ReadingTaskQuestionMark_ReadingQuestionTrial_QuestionId",
|
|
table: "ReadingTaskQuestionMark");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "IsSubjectQuit",
|
|
table: "Subject");
|
|
|
|
migrationBuilder.AlterColumn<Guid>(
|
|
name: "TrialReadingCriterionId",
|
|
table: "TrialEmailNoticeConfig",
|
|
type: "uniqueidentifier",
|
|
nullable: true,
|
|
oldClrType: typeof(Guid),
|
|
oldType: "uniqueidentifier",
|
|
oldNullable: true,
|
|
oldComment: "下次版本删除");
|
|
|
|
migrationBuilder.AlterColumn<Guid>(
|
|
name: "QuestionId",
|
|
table: "ReadingTaskQuestionMark",
|
|
type: "uniqueidentifier",
|
|
nullable: false,
|
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
|
oldClrType: typeof(Guid),
|
|
oldType: "uniqueidentifier",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "CriterionTypeEnum",
|
|
table: "EmailNoticeConfig",
|
|
type: "int",
|
|
nullable: true,
|
|
comment: "标准枚举--后续废弃,这里可以选择多个标准");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_ReadingTaskQuestionMark_ReadingQuestionTrial_QuestionId",
|
|
table: "ReadingTaskQuestionMark",
|
|
column: "QuestionId",
|
|
principalTable: "ReadingQuestionTrial",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
}
|
|
}
|