diff --git a/resources/migrations/001_update_migrations.yaml b/resources/migrations/001_update_migrations.yaml index f8a532ef898c79a369e482b3db5ccd18ec544d44..51041e9ab656040bf495d7e62b121a221323281a 100644 --- a/resources/migrations/001_update_migrations.yaml +++ b/resources/migrations/001_update_migrations.yaml @@ -5529,6 +5529,13 @@ databaseChangeLog: sql: INSERT INTO setting ("KEY", "VALUE") VALUES ('enable-public-sharing', 'false'); rollback: # not needed + - changeSet: + id: v49.2024-03-26T20:27:58 + author: noahmoss + comment: Added 0.46.0 - Delete the truncate audit log task (renamed to truncate audit tables) + changes: + - customChange: + class: "metabase.db.custom_migrations.DeleteTruncateAuditLogTask" # >>>>>>>>>> DO NOT ADD NEW MIGRATIONS BELOW THIS LINE! ADD THEM ABOVE <<<<<<<<<< diff --git a/src/metabase/db/custom_migrations.clj b/src/metabase/db/custom_migrations.clj index 055c59126a2eab36400053bffbd282afa2b2424d..2f25ff887c6b8e0d4524475ad526006fba2120a2 100644 --- a/src/metabase/db/custom_migrations.clj +++ b/src/metabase/db/custom_migrations.clj @@ -1067,3 +1067,13 @@ (run! rollback! (t2/reducible-query {:select [:*] :from [:revision] :where [:= :model "Card"]}))))) + +;; This was renamed to TruncateAuditTables, so we need to delete the old job & trigger +(define-migration DeleteTruncateAuditLogTask + (classloader/the-classloader) + (set-jdbc-backend-properties!) + (let [scheduler (qs/initialize)] + (qs/start scheduler) + (qs/delete-trigger scheduler (triggers/key "metabase.task.truncate-audit-log.trigger")) + (qs/delete-job scheduler (jobs/key "metabase.task.truncate-audit-log.job")) + (qs/shutdown scheduler)))