feat: 트리거 감사 로그 Swagger 문서 추가 및 api_request_logs 제외

- TriggerAuditLogApi.php Swagger 파일 생성 (6개 엔드포인트 문서화)
  - 목록 조회, 통계, 상세, 레코드 이력, 롤백 미리보기, 롤백 실행
- api_request_logs를 트리거 제외 테이블 목록에 추가
- Pint 포매팅 적용

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-09 16:55:34 +09:00
parent 5eaa5f036b
commit 9bae7fccae
3 changed files with 2001 additions and 4 deletions

View File

@@ -24,6 +24,7 @@
'failed_jobs',
'migrations',
'password_reset_tokens',
'api_request_logs',
];
/** 변경 추적 제외 컬럼 */
@@ -56,6 +57,7 @@ public function up(): void
if (in_array($tableName, $this->excludeTables, true)) {
$skipped++;
continue;
}
@@ -106,12 +108,12 @@ private function createTriggersForTable(string $dbName, string $tableName): void
$pk = $pkRow->COLUMN_NAME;
// 컬럼 목록 (제외 컬럼 필터링)
$columns = DB::select("
$columns = DB::select('
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = ? AND TABLE_NAME = ?
ORDER BY ORDINAL_POSITION
", [$dbName, $tableName]);
', [$dbName, $tableName]);
$cols = [];
$hasTenantId = false;
@@ -144,8 +146,8 @@ private function createTriggersForTable(string $dbName, string $tableName): void
$cols
));
$tenantNew = $hasTenantId ? "NEW.`tenant_id`" : 'NULL';
$tenantOld = $hasTenantId ? "OLD.`tenant_id`" : 'NULL';
$tenantNew = $hasTenantId ? 'NEW.`tenant_id`' : 'NULL';
$tenantOld = $hasTenantId ? 'OLD.`tenant_id`' : 'NULL';
// 기존 트리거 삭제
DB::unprepared("DROP TRIGGER IF EXISTS `trg_{$tableName}_ai`");