using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
///
public partial class Segmentation : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Segment",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
SegmentationId = table.Column(type: "uniqueidentifier", nullable: false),
SegmentMumber = table.Column(type: "int", nullable: false),
SegmentName = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false),
ColorRgb = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false),
AvgValue = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
MaxValue = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
MinValue = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
Variance = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
Median = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
Volume = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
MajorAxis = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
ShortAxis = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
Peak = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
TLG = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
MTV = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: true),
DeleteUserId = table.Column(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column(type: "bit", nullable: false),
DeletedTime = table.Column(type: "datetime2", nullable: true),
CreateUserId = table.Column(type: "uniqueidentifier", nullable: false),
CreateTime = table.Column(type: "datetime2", nullable: false),
UpdateUserId = table.Column(type: "uniqueidentifier", nullable: false),
UpdateTime = table.Column(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Segment", x => x.Id)
.Annotation("SqlServer:Clustered", false);
table.ForeignKey(
name: "FK_Segment_User_CreateUserId",
column: x => x.CreateUserId,
principalTable: "User",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
},
comment: "分割");
migrationBuilder.CreateTable(
name: "Segmentation",
columns: table => new
{
Id = table.Column(type: "uniqueidentifier", nullable: false),
TrialId = table.Column(type: "uniqueidentifier", nullable: false),
SubjectId = table.Column(type: "uniqueidentifier", nullable: false),
SubjectVisitId = table.Column(type: "uniqueidentifier", nullable: false),
VisitTaksId = table.Column(type: "uniqueidentifier", nullable: false),
StudyId = table.Column(type: "uniqueidentifier", nullable: false),
SeriesId = table.Column(type: "uniqueidentifier", nullable: false),
SegmentationName = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false),
SegmentationJson = table.Column(type: "nvarchar(max)", nullable: false),
SEGUrl = table.Column(type: "nvarchar(max)", nullable: false),
DeleteUserId = table.Column(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column(type: "bit", nullable: false),
DeletedTime = table.Column(type: "datetime2", nullable: true),
CreateUserId = table.Column(type: "uniqueidentifier", nullable: false),
CreateTime = table.Column(type: "datetime2", nullable: false),
UpdateUserId = table.Column(type: "uniqueidentifier", nullable: false),
UpdateTime = table.Column(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Segmentation", x => x.Id)
.Annotation("SqlServer:Clustered", false);
table.ForeignKey(
name: "FK_Segmentation_User_CreateUserId",
column: x => x.CreateUserId,
principalTable: "User",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
},
comment: "分割分组");
migrationBuilder.CreateIndex(
name: "IX_Segment_CreateTime",
table: "Segment",
column: "CreateTime")
.Annotation("SqlServer:Clustered", true);
migrationBuilder.CreateIndex(
name: "IX_Segmentation_CreateTime",
table: "Segmentation",
column: "CreateTime")
.Annotation("SqlServer:Clustered", true);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Segment");
migrationBuilder.DropTable(
name: "Segmentation");
}
}
}