Implemented centralised audit logging

This commit is contained in:
2026-09-21 16:32:56 +02:00
parent 78b03b6996
commit f4024d563a
41 changed files with 5751 additions and 54 deletions
@@ -0,0 +1,64 @@
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");
}
}
}