188 lines
6.3 KiB
C#
188 lines
6.3 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class Segment : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "Priority",
|
|
table: "UploadFileSyncRecord");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "UploadFinishedTime",
|
|
table: "FileUploadRecord");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "syncFinishedTime",
|
|
table: "FileUploadRecord",
|
|
newName: "SyncFinishedTime");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "UploadRegion",
|
|
table: "FileUploadRecord",
|
|
type: "nvarchar(400)",
|
|
maxLength: 400,
|
|
nullable: false,
|
|
comment: "上传区域",
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(400)",
|
|
oldMaxLength: 400);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "FileType",
|
|
table: "FileUploadRecord",
|
|
type: "nvarchar(400)",
|
|
maxLength: 400,
|
|
nullable: false,
|
|
comment: "文件类型",
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(400)",
|
|
oldMaxLength: 400);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "BatchDataType",
|
|
table: "FileUploadRecord",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
comment: "该批次数据类型");
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "DicomStudyId",
|
|
table: "FileUploadRecord",
|
|
type: "uniqueidentifier",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "NoneDicomStudyId",
|
|
table: "FileUploadRecord",
|
|
type: "uniqueidentifier",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "Priority",
|
|
table: "FileUploadRecord",
|
|
type: "int",
|
|
nullable: true,
|
|
comment: "同步优先级");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "TargetRegion",
|
|
table: "FileUploadRecord",
|
|
type: "nvarchar(400)",
|
|
maxLength: 400,
|
|
nullable: false,
|
|
defaultValue: "",
|
|
comment: "目标区域");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "UploadBatchId",
|
|
table: "FileUploadRecord",
|
|
type: "nvarchar(400)",
|
|
maxLength: 400,
|
|
nullable: false,
|
|
defaultValue: "",
|
|
comment: "上传批次");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_FileUploadRecord_DicomStudy_DicomStudyId",
|
|
table: "FileUploadRecord",
|
|
column: "DicomStudyId",
|
|
principalTable: "DicomStudy",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_FileUploadRecord_NoneDicomStudy_NoneDicomStudyId",
|
|
table: "FileUploadRecord",
|
|
column: "NoneDicomStudyId",
|
|
principalTable: "NoneDicomStudy",
|
|
principalColumn: "Id");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_FileUploadRecord_DicomStudy_DicomStudyId",
|
|
table: "FileUploadRecord");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_FileUploadRecord_NoneDicomStudy_NoneDicomStudyId",
|
|
table: "FileUploadRecord");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "BatchDataType",
|
|
table: "FileUploadRecord");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "DicomStudyId",
|
|
table: "FileUploadRecord");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "NoneDicomStudyId",
|
|
table: "FileUploadRecord");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "Priority",
|
|
table: "FileUploadRecord");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "TargetRegion",
|
|
table: "FileUploadRecord");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "UploadBatchId",
|
|
table: "FileUploadRecord");
|
|
|
|
migrationBuilder.RenameColumn(
|
|
name: "SyncFinishedTime",
|
|
table: "FileUploadRecord",
|
|
newName: "syncFinishedTime");
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "Priority",
|
|
table: "UploadFileSyncRecord",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "UploadRegion",
|
|
table: "FileUploadRecord",
|
|
type: "nvarchar(400)",
|
|
maxLength: 400,
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(400)",
|
|
oldMaxLength: 400,
|
|
oldComment: "上传区域");
|
|
|
|
migrationBuilder.AlterColumn<string>(
|
|
name: "FileType",
|
|
table: "FileUploadRecord",
|
|
type: "nvarchar(400)",
|
|
maxLength: 400,
|
|
nullable: false,
|
|
oldClrType: typeof(string),
|
|
oldType: "nvarchar(400)",
|
|
oldMaxLength: 400,
|
|
oldComment: "文件类型");
|
|
|
|
migrationBuilder.AddColumn<DateTime>(
|
|
name: "UploadFinishedTime",
|
|
table: "FileUploadRecord",
|
|
type: "datetime2",
|
|
nullable: false,
|
|
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
|
comment: "上传结束时间");
|
|
}
|
|
}
|
|
}
|