using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace IRaCIS.Core.Infra.EFCore.Migrations { /// public partial class siteSurveylog : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "SiteSurveyLog", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), TrialSiteSurveyId = table.Column(type: "uniqueidentifier", nullable: false), Name = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), UserType = table.Column(type: "int", nullable: false), OptType = table.Column(type: "int", nullable: false), Reason = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), Json = table.Column(type: "nvarchar(max)", nullable: false), OriginTrialSiteSurveyId = table.Column(type: "uniqueidentifier", nullable: true, comment: "更新调研表之前的调研表"), CreateUserId = table.Column(type: "uniqueidentifier", nullable: false), CreateTime = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SiteSurveyLog", x => x.Id) .Annotation("SqlServer:Clustered", false); table.ForeignKey( name: "FK_SiteSurveyLog_TrialSiteSurvey_TrialSiteSurveyId", column: x => x.TrialSiteSurveyId, principalTable: "TrialSiteSurvey", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_SiteSurveyLog_User_CreateUserId", column: x => x.CreateUserId, principalTable: "User", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_SiteSurveyLog_CreateTime", table: "SiteSurveyLog", column: "CreateTime") .Annotation("SqlServer:Clustered", true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "SiteSurveyLog"); } } }