using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace IRaCIS.Core.Infra.EFCore.Migrations { /// public partial class svBack : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "ImageBackState", table: "SubjectVisit"); migrationBuilder.CreateTable( name: "SubjectVisitImageBackRecord", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), SubjectVisitId = table.Column(type: "uniqueidentifier", nullable: false), ApplyUserRole = table.Column(type: "int", nullable: false), ImageBackState = table.Column(type: "int", nullable: false, comment: "影像上传 回退"), AuditTime = 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_SubjectVisitImageBackRecord", x => x.Id); table.ForeignKey( name: "FK_SubjectVisitImageBackRecord_SubjectVisit_SubjectVisitId", column: x => x.SubjectVisitId, principalTable: "SubjectVisit", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_SubjectVisitImageBackRecord_User_CreateUserId", column: x => x.CreateUserId, principalTable: "User", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }, comment: "受试者访视影像回退记录表"); migrationBuilder.CreateIndex( name: "IX_SubjectVisitImageBackRecord_CreateUserId", table: "SubjectVisitImageBackRecord", column: "CreateUserId"); migrationBuilder.CreateIndex( name: "IX_SubjectVisitImageBackRecord_SubjectVisitId", table: "SubjectVisitImageBackRecord", column: "SubjectVisitId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "SubjectVisitImageBackRecord"); migrationBuilder.AddColumn( name: "ImageBackState", table: "SubjectVisit", type: "int", nullable: false, defaultValue: 0, comment: "影像上传 回退"); } } }