chore(mcp-analytics): make remaining MCPSession backfill columns nullable#60035
Merged
Conversation
Contributor
|
Reviews (1): Last reviewed commit: "chore(mcp): slim dormant MCPSession mode..." | Re-trigger Greptile |
Contributor
Migration SQL ChangesHey 👋, we've detected some migrations on this PR. Here's the SQL output for each migration, make sure they make sense:
|
Contributor
🔍 Migration Risk AnalysisWe've analyzed your migrations for potential risks. Summary: 0 Safe | 1 Needs Review | 0 Blocked
|
ce1bcf8 to
e7d3ea1
Compare
76a85ab to
7ab495f
Compare
e7d3ea1 to
68270c6
Compare
#60041 relaxed session_start/session_end/duration_seconds to nullable; this completes the set for the other dormant backfill-mirror columns (tools_used, tool_call_count, distinct_id, mcp_client_name). DROP NOT NULL is an instant, non-destructive metadata change. These columns are written only by the (de-registered, being-removed) backfill job; the live sessions list aggregates from events and never reads them. Relaxing the constraints is safe prep toward removing the columns entirely in a later cleanup — the model fields stay for now. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
68270c6 to
d506ecf
Compare
Contributor
|
Reviews (2): Last reviewed commit: "chore(mcp): make remaining MCPSession ba..." | Re-trigger Greptile |
thmsobrmlr
approved these changes
May 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
MCPSession's backfill-mirror columns are dormant — the live sessions list aggregates from events on the fly and never reads them, and the only writer (thebackfill-mcp-sessionsjob) is being removed in #60039. They're on the path to deletion, but the safe first step is relaxing theirNOT NULLconstraints.#60041 already did this for
session_start/session_end/duration_seconds. This completes the set for the remaining four.Changes
DROP NOT NULLontools_used,tool_call_count,distinct_id,mcp_client_name(instant, non-destructive metadata change). The model fields stay in place for now; physically dropping the columns is a later cleanup once these constraints are relaxed and the jobs (#60039) are gone.How did you test this code?
Agent-authored. Verified
makemigrations --checkreports no drift,sqlmigrateemits only the fourDROP NOT NULLs, and ruff passes.Docs update
no
🤖 Agent context
Authored with Claude Code (Opus 4.7). Part of the incremental MCP-analytics cleanup: (1) #60039 remove the dormant backfill/summarize jobs, (2) this — finish relaxing the backfill columns to nullable (mirrors #60041), (3) a later PR removes the fields + physically drops the columns. Kept small and non-destructive on purpose.