add migraiton sql for skip_audit_log_database#22487
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22487 +/- ##
===========================================
+ Coverage 45.36% 65.84% +20.47%
===========================================
Files 244 1073 +829
Lines 13333 116105 +102772
Branches 2719 2931 +212
===========================================
+ Hits 6049 76450 +70401
- Misses 6983 35414 +28431
- Partials 301 4241 +3940
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Why is this magic happening in the DB schema migration script and not simply via config flags? When do you think this will be set? All existing users have audit logs. |
This PR sets a value for skip_audit_log_database to handle the scenario where the database is used as the audit log storage. Previously, we introduced a new env to control whether to skip using the database for audit logs. However, this change could break existing setups when upgrading from older Harbor versions that already use the database. This PR is the second step in that change — ensuring the new environment variable only takes effect for fresh installations. During upgrades, if the existing setup uses the database for audit logs, give a value to index it and then behavior will be preserved. |
691a799 to
8d1a8ae
Compare
give the value of skip_audit_log_database bases on the real usage. 1. If audit logs exist in the system (either in audit_log or audit_log_ext tables), set skip_audit_log_database to false 2. If no audit logs exist but the tables show evidence of previous usage set skip_audit_log_database to false Signed-off-by: wang yan <[email protected]>
8d1a8ae to
b5b52c9
Compare
give the value of skip_audit_log_database bases on the real usage. 1. If audit logs exist in the system (either in audit_log or audit_log_ext tables), set skip_audit_log_database to false 2. If no audit logs exist but the tables show evidence of previous usage set skip_audit_log_database to false Signed-off-by: wang yan <[email protected]> Co-authored-by: wang yan <[email protected]>
give the value of skip_audit_log_database bases on the real usage.
Thank you for contributing to Harbor!
Comprehensive Summary of your change
Issue being fixed
Fixes #(issue)
Please indicate you've done the following: