using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace IRaCIS.Core.Infra.EFCore.Migrations { /// public partial class KeyFile : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "CriterionKeyFileRead", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), TrialCriterionId = table.Column(type: "uniqueidentifier", nullable: false), IdentityUserId = table.Column(type: "uniqueidentifier", nullable: false), CreateUserId = table.Column(type: "uniqueidentifier", nullable: false), CreateTime = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_CriterionKeyFileRead", x => x.Id); table.ForeignKey( name: "FK_CriterionKeyFileRead_User_CreateUserId", column: x => x.CreateUserId, principalTable: "User", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }, comment: "标准阅读关键点"); migrationBuilder.CreateTable( name: "SystemCriterionKeyFile", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), SystemCriterionId = table.Column(type: "uniqueidentifier", nullable: false), FileName = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), FilePath = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), CreateUserId = table.Column(type: "uniqueidentifier", nullable: false), CreateTime = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SystemCriterionKeyFile", x => x.Id); table.ForeignKey( name: "FK_SystemCriterionKeyFile_User_CreateUserId", column: x => x.CreateUserId, principalTable: "User", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }, comment: "系统标准阅片关键点文件"); migrationBuilder.CreateTable( name: "TrialCriterionKeyFile", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), TrialCriterionId = table.Column(type: "uniqueidentifier", nullable: false), FileName = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), FilePath = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), CreateUserId = table.Column(type: "uniqueidentifier", nullable: false), CreateTime = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_TrialCriterionKeyFile", x => x.Id); table.ForeignKey( name: "FK_TrialCriterionKeyFile_User_CreateUserId", column: x => x.CreateUserId, principalTable: "User", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }, comment: "项目标准阅片关键点文件"); migrationBuilder.CreateIndex( name: "IX_ReadingTableAnswerRowInfo_SeriesId", table: "ReadingTableAnswerRowInfo", column: "SeriesId"); migrationBuilder.CreateIndex( name: "IX_ReadingTableAnswerRowInfo_StudyId", table: "ReadingTableAnswerRowInfo", column: "StudyId"); migrationBuilder.CreateIndex( name: "IX_CriterionKeyFileRead_CreateUserId", table: "CriterionKeyFileRead", column: "CreateUserId"); migrationBuilder.CreateIndex( name: "IX_SystemCriterionKeyFile_CreateUserId", table: "SystemCriterionKeyFile", column: "CreateUserId"); migrationBuilder.CreateIndex( name: "IX_TrialCriterionKeyFile_CreateUserId", table: "TrialCriterionKeyFile", column: "CreateUserId"); migrationBuilder.AddForeignKey( name: "FK_ReadingTableAnswerRowInfo_DicomSeries_SeriesId", table: "ReadingTableAnswerRowInfo", column: "SeriesId", principalTable: "DicomSeries", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_ReadingTableAnswerRowInfo_NoneDicomStudy_StudyId", table: "ReadingTableAnswerRowInfo", column: "StudyId", principalTable: "NoneDicomStudy", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_ReadingTableAnswerRowInfo_DicomSeries_SeriesId", table: "ReadingTableAnswerRowInfo"); migrationBuilder.DropForeignKey( name: "FK_ReadingTableAnswerRowInfo_NoneDicomStudy_StudyId", table: "ReadingTableAnswerRowInfo"); migrationBuilder.DropTable( name: "CriterionKeyFileRead"); migrationBuilder.DropTable( name: "SystemCriterionKeyFile"); migrationBuilder.DropTable( name: "TrialCriterionKeyFile"); migrationBuilder.DropIndex( name: "IX_ReadingTableAnswerRowInfo_SeriesId", table: "ReadingTableAnswerRowInfo"); migrationBuilder.DropIndex( name: "IX_ReadingTableAnswerRowInfo_StudyId", table: "ReadingTableAnswerRowInfo"); } } }