86 lines
3.4 KiB
C#
86 lines
3.4 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class EmailRecipientLog : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "CcRecipients",
|
|
table: "EmailLog");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "ToRecipients",
|
|
table: "EmailLog");
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "EmailRecipientLog",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
EmailLogId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
RecipientName = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
|
RecipientAddress = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
|
RecipientTypeEnum = table.Column<int>(type: "int", nullable: false),
|
|
Sort = table.Column<int>(type: "int", nullable: false),
|
|
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_EmailRecipientLog", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_EmailRecipientLog_EmailLog_EmailLogId",
|
|
column: x => x.EmailLogId,
|
|
principalTable: "EmailLog",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
table.ForeignKey(
|
|
name: "FK_EmailRecipientLog_User_CreateUserId",
|
|
column: x => x.CreateUserId,
|
|
principalTable: "User",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
},
|
|
comment: "邮件收件人");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_EmailRecipientLog_CreateUserId",
|
|
table: "EmailRecipientLog",
|
|
column: "CreateUserId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_EmailRecipientLog_EmailLogId",
|
|
table: "EmailRecipientLog",
|
|
column: "EmailLogId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "EmailRecipientLog");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "CcRecipients",
|
|
table: "EmailLog",
|
|
type: "nvarchar(max)",
|
|
nullable: true);
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "ToRecipients",
|
|
table: "EmailLog",
|
|
type: "nvarchar(max)",
|
|
nullable: true);
|
|
}
|
|
}
|
|
}
|