using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace IRaCIS.Core.Infra.EFCore.Migrations { /// public partial class SegmentationVersion : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "FileSize", table: "Segmentation", type: "bigint", nullable: false, defaultValue: 0L); migrationBuilder.CreateTable( name: "SegmentationVersion", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), SegmentationId = table.Column(type: "uniqueidentifier", nullable: false), Version = table.Column(type: "int", nullable: false), SegmentationJson = table.Column(type: "nvarchar(max)", nullable: false), SEGUrl = table.Column(type: "nvarchar(max)", nullable: false), FileSize = table.Column(type: "bigint", nullable: false), CreateUserId = table.Column(type: "uniqueidentifier", nullable: false), CreateTime = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SegmentationVersion", x => x.Id) .Annotation("SqlServer:Clustered", false); }, comment: "分割文件版本"); migrationBuilder.CreateIndex( name: "IX_SegmentationVersion_CreateTime", table: "SegmentationVersion", column: "CreateTime") .Annotation("SqlServer:Clustered", true); migrationBuilder.AddForeignKey( name: "FK_Segmentation_VisitTask_VisitTaskId", table: "Segmentation", column: "VisitTaskId", principalTable: "VisitTask", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Segmentation_VisitTask_VisitTaskId", table: "Segmentation"); migrationBuilder.DropTable( name: "SegmentationVersion"); migrationBuilder.DropColumn( name: "FileSize", table: "Segmentation"); } } }