From 62924891923459a32db47c0ef736dcff969baadb Mon Sep 17 00:00:00 2001 From: Mateo Wang <277851410+mateo-berri@users.noreply.github.com> Date: Wed, 19 Aug 2026 17:27:33 -0700 Subject: [PATCH] fix(spend-logs): backfill created_at/updated_at from endTime instead of migration time (#37554) --- .../migration.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 litellm-proxy-extras/litellm_proxy_extras/migrations/20260819000000_backfill_spend_log_timestamps/migration.sql diff --git a/litellm-proxy-extras/litellm_proxy_extras/migrations/20260819000000_backfill_spend_log_timestamps/migration.sql b/litellm-proxy-extras/litellm_proxy_extras/migrations/20260819000000_backfill_spend_log_timestamps/migration.sql new file mode 100644 index 00000000000..10003afa9db --- /dev/null +++ b/litellm-proxy-extras/litellm_proxy_extras/migrations/20260819000000_backfill_spend_log_timestamps/migration.sql @@ -0,0 +1,4 @@ +UPDATE "LiteLLM_SpendLogs" +SET "created_at" = "endTime", + "updated_at" = "endTime" +WHERE "created_at" > "endTime" + interval '1 hour';