Merge branch 'develop' of http://114.203.209.83:3000/SamProject/sam-api into develop

This commit is contained in:
김보곤
2026-02-10 10:02:16 +09:00
7 changed files with 2125 additions and 63 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`");