Files
pfm/PostFundManagement.Infrastructure/Database/Migrations/20260921125152_UpdateAuditLog.cs
T

65 lines
1.9 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace PostFundManagement.Infrastructure.Database.Migrations
{
/// <inheritdoc />
public partial class UpdateAuditLog : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "EntityId",
table: "AuditLogs",
type: "text",
nullable: false,
oldClrType: typeof(long),
oldType: "bigint");
migrationBuilder.AddColumn<long>(
name: "TenantId",
table: "AuditLogs",
type: "bigint",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_AuditLogs_TenantId",
table: "AuditLogs",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_AuditLogs_Tenants_TenantId",
table: "AuditLogs",
column: "TenantId",
principalTable: "Tenants",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AuditLogs_Tenants_TenantId",
table: "AuditLogs");
migrationBuilder.DropIndex(
name: "IX_AuditLogs_TenantId",
table: "AuditLogs");
migrationBuilder.DropColumn(
name: "TenantId",
table: "AuditLogs");
migrationBuilder.AlterColumn<long>(
name: "EntityId",
table: "AuditLogs",
type: "bigint",
nullable: false,
oldClrType: typeof(string),
oldType: "text");
}
}
}