Implemented centralised audit logging
This commit is contained in:
+64
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user