Skip to content

Commit

Permalink
BE-010: Allocated all error column into appLogs table
Browse files Browse the repository at this point in the history
Background:
appLogs table already design to pool error logs from many tables, and for now there still 2 table left that doesn’t pool their error logs into this table.
Unified it into single table

Possibility Issue:
- Take time to search error logs for 2 left table

Resolution:
- Patch or update 2 left table to remove any specific error column
- Set foreign key to appLogs from processId
- Patch or update appLogs table to pool more information like dateModified

Signed-off-by: Dicky Herlambang (花) <herlambangdicky5@gmail.com>
  • Loading branch information
Nicklas373 committed May 10, 2024
1 parent a58ed25 commit e39e6e1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion database/migrations/2024_01_01_000000_init_pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public function up(): void
Schema::create('appLogs', function (Blueprint $table) {
$table->uuid('processId');
$table->text('errReason')->nullable();
$table->text('errApiReason')->nullable();
$table->text('errStatus')->nullable();
$table->timestamp('createdAt');

// Configure primary key
$table->primary('processId');
Expand All @@ -35,6 +36,8 @@ public function up(): void
$table->foreign('processId')->references('processId')->on('pdfWatermark')->name('pdf_watermark_fk');
$table->foreign('processId')->references('processId')->on('pdfHtml')->name('pdf_html_fk');
$table->foreign('processId')->references('processId')->on('jobLogs')->name('job_logs_fk');
$table->foreign('processId')->references('processId')->on('accessLogs')->name('access_logs_fk');
$table->foreign('processId')->references('processId')->on('notifyLogs')->name('notify_logs_fk');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ public function up(): void
$table->uuid('processId');
$table->text('routePath')->nullable();
$table->text('accessIpAddress')->nullable();
$table->text('routeExceptionMessage')->nullable();
$table->text('routeExceptionLog')->nullable();

// Configure foreign key
$table->foreign('processId')->references('processId')->on('appLogs');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ public function up(): void
$table->boolean('notifyResult');
$table->text('notifyMessage')->nullable();
$table->json('notifyResponse')->nullable();
$table->text('notifyErrStatus')->nullable();
$table->text('notifyErrMessage')->nullable();

// Configure foreign key
$table->foreign('processId')->references('processId')->on('appLogs');
});
}

Expand Down

0 comments on commit e39e6e1

Please sign in to comment.