using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace IRaCIS.Core.Infra.EFCore.Migrations { /// public partial class EmailLog : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "EmailLog", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), MessageId = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), UniqueId = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), EmailSubject = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), ToRecipients = table.Column(type: "nvarchar(max)", nullable: false), CcRecipients = table.Column(type: "nvarchar(max)", nullable: false), Attachments = table.Column(type: "nvarchar(max)", nullable: false), EmailDate = table.Column(type: "datetime2", nullable: true), ErrorInfo = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), SenderAddress = table.Column(type: "nvarchar(400)", maxLength: 400, nullable: false), EmailStateEnum = table.Column(type: "int", 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_EmailLog", x => x.Id); table.ForeignKey( name: "FK_EmailLog_User_CreateUserId", column: x => x.CreateUserId, principalTable: "User", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }, comment: "邮件日志"); migrationBuilder.CreateIndex( name: "IX_EmailLog_CreateUserId", table: "EmailLog", column: "CreateUserId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "EmailLog"); } } }