using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace IRaCIS.Core.Infra.EFCore.Migrations { /// public partial class EmailAttachmentLog : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "Attachments", table: "EmailLog"); migrationBuilder.CreateTable( name: "EmailAttachmentLog", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), EmailLogId = table.Column(type: "uniqueidentifier", nullable: false), AttachmentName = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), AttachmentPath = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), 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_EmailAttachmentLog", x => x.Id); table.ForeignKey( name: "FK_EmailAttachmentLog_EmailLog_EmailLogId", column: x => x.EmailLogId, principalTable: "EmailLog", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_EmailAttachmentLog_User_CreateUserId", column: x => x.CreateUserId, principalTable: "User", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }, comment: "邮件附件日志"); migrationBuilder.CreateIndex( name: "IX_EmailAttachmentLog_CreateUserId", table: "EmailAttachmentLog", column: "CreateUserId"); migrationBuilder.CreateIndex( name: "IX_EmailAttachmentLog_EmailLogId", table: "EmailAttachmentLog", column: "EmailLogId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "EmailAttachmentLog"); migrationBuilder.AddColumn( name: "Attachments", table: "EmailLog", type: "nvarchar(max)", nullable: true); } } }