122 lines
4.1 KiB
C#
122 lines
4.1 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class ImageDown : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_SCPInstance_SCPStudy_StudyId",
|
|
table: "SCPInstance");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_SCPStudySubjectVisit_SCPStudy_SCPStudyId",
|
|
table: "SCPStudySubjectVisit");
|
|
|
|
migrationBuilder.AddColumn<DateTime>(
|
|
name: "DownloadEndTime",
|
|
table: "SubejctVisitDownload",
|
|
type: "datetime2",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<DateTime>(
|
|
name: "DownloadStartTime",
|
|
table: "SubejctVisitDownload",
|
|
type: "datetime2",
|
|
nullable: false,
|
|
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
|
|
|
migrationBuilder.AddColumn<int>(
|
|
name: "ImageCount",
|
|
table: "SubejctVisitDownload",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0);
|
|
|
|
migrationBuilder.AddColumn<long>(
|
|
name: "ImageSize",
|
|
table: "SubejctVisitDownload",
|
|
type: "bigint",
|
|
nullable: false,
|
|
defaultValue: 0L);
|
|
|
|
migrationBuilder.AddColumn<bool>(
|
|
name: "IsSuccess",
|
|
table: "SubejctVisitDownload",
|
|
type: "bit",
|
|
nullable: false,
|
|
defaultValue: false);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_SCPInstance_SCPStudy_StudyId",
|
|
table: "SCPInstance",
|
|
column: "StudyId",
|
|
principalTable: "SCPStudy",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_SCPStudySubjectVisit_SCPStudy_SCPStudyId",
|
|
table: "SCPStudySubjectVisit",
|
|
column: "SCPStudyId",
|
|
principalTable: "SCPStudy",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_SCPInstance_SCPStudy_StudyId",
|
|
table: "SCPInstance");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_SCPStudySubjectVisit_SCPStudy_SCPStudyId",
|
|
table: "SCPStudySubjectVisit");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "DownloadEndTime",
|
|
table: "SubejctVisitDownload");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "DownloadStartTime",
|
|
table: "SubejctVisitDownload");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "ImageCount",
|
|
table: "SubejctVisitDownload");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "ImageSize",
|
|
table: "SubejctVisitDownload");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "IsSuccess",
|
|
table: "SubejctVisitDownload");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_SCPInstance_SCPStudy_StudyId",
|
|
table: "SCPInstance",
|
|
column: "StudyId",
|
|
principalTable: "SCPStudy",
|
|
principalColumn: "SeqId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_SCPStudySubjectVisit_SCPStudy_SCPStudyId",
|
|
table: "SCPStudySubjectVisit",
|
|
column: "SCPStudyId",
|
|
principalTable: "SCPStudy",
|
|
principalColumn: "SeqId",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
}
|
|
}
|