mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 13:10:37 -04:00
fix(audit): stop duplicate and empty audit rows
- Set env var version and compose parsing version while creating, so a create writes one row - Record no rows for the auto-created preview copy of an env var - Record env and application API updates only with the fields that really changed - Store no change data for new env vars, and null for empty change data - Store metadata team_id as an integer - Drop the unused level and resource indexes of audit_events Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
13298591d8
commit
b7d0e6be2a
@@ -71,6 +71,19 @@ if (! function_exists('auditChangedFields')) {
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('auditSavedFields')) {
|
||||
/**
|
||||
* Names of the attributes that the last save() really changed, without timestamps.
|
||||
* Call it after save(), so changes made by saving hooks are included.
|
||||
*
|
||||
* @return array<int, string>
|
||||
*/
|
||||
function auditSavedFields(Model $model): array
|
||||
{
|
||||
return array_values(array_diff(array_keys($model->getChanges()), ['created_at', 'updated_at']));
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('auditFailureDeduplicationWindow')) {
|
||||
/**
|
||||
* Seconds during which repeated unauthenticated or permission failures from one source are recorded once.
|
||||
|
||||
Reference in New Issue
Block a user