diff --git a/code/web/cron/backupAspen.php b/code/web/cron/backupAspen.php index 9ac08e334a..4748ca7a76 100644 --- a/code/web/cron/backupAspen.php +++ b/code/web/cron/backupAspen.php @@ -23,9 +23,9 @@ mkdir($backupDir, 700, true); } -//Remove any backups older than 3 days +//Remove any backups older than 2 days $currentFilesInBackup = scandir($backupDir); -$earliestTimeToKeep = time() - (3 * 24 * 60 * 60); +$earliestTimeToKeep = time() - (2 * 24 * 60 * 60); foreach ($currentFilesInBackup as $file) { $okToProcess = false; if (strlen($file) > 4) { diff --git a/code/web/release_notes/24.05.02.MD b/code/web/release_notes/24.05.02.MD index 837cb85b94..a8d1e6b992 100644 --- a/code/web/release_notes/24.05.02.MD +++ b/code/web/release_notes/24.05.02.MD @@ -10,6 +10,8 @@ ### Other Updates - Update import script to ignore sandbox mode if not available. (*MDN*) +- Remove unused triggers from the database. (*MDN*) +- Only keep 2 days of backups on the server itself. (*MDN*) ## This release includes code contributions from - ByWater Solutions diff --git a/code/web/sys/DBMaintenance/version_updates/24.05.02.php b/code/web/sys/DBMaintenance/version_updates/24.05.02.php new file mode 100644 index 0000000000..40fb0c98fb --- /dev/null +++ b/code/web/sys/DBMaintenance/version_updates/24.05.02.php @@ -0,0 +1,30 @@ + [ + 'title' => '', + 'description' => '', + 'continueOnError' => false, + 'sql' => [ + '' + ] + ], //name*/ + + //mark - ByWater + 'remove_used_triggers' => [ + 'title' => 'Remove Unused Triggers', + 'description' => 'Remove Unused Triggers', + 'continueOnError' => true, + 'sql' => [ + 'DROP TRIGGER after_grouped_work_record_items_delete', + 'DROP TRIGGER after_grouped_work_records_delete', + 'DROP TRIGGER after_grouped_work_delete', + 'DROP TRIGGER after_scope_delete', + ] + ], //remove_used_triggers + + ]; +} \ No newline at end of file