Repository navigation
Fix: ensure tenant_ocr_id is added - #18560
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe database migration now adds the nullable, indexed ChangesTenant schema alignment
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This localized change has no actionable merge-blocking risk remaining and is merge-ready after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18560 +/- ##
=======================================
Coverage 90.65% 90.65%
=======================================
Files 10 10
Lines 717 717
Branches 118 118
=======================================
Hits 650 650
Misses 39 39
Partials 28 28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
wangq8
left a comment
There was a problem hiding this comment.
Thanks for the fix. This looks correct and complete.
Verification
Tenant.tenant_ocr_idis declared in the model (CharField(max_length=32, null=True, help_text="id in tenant_model", index=True)), but it was missing frommigrate_db(), so existing deployments never got the column while fresh installs (which create the full model) did — leading to inconsistent schema and runtime failures when a tenant OCR model is configured.- The added migration matches the model definition exactly (
max_length=32,null=True,index=True), consistent with the siblingtenant_*_idcolumns. alter_db_add_columnis idempotent (it catches and skips duplicate-column errors), so this is safe to run on both fresh installs and existing databases.- Placement directly after the existing
ocr_idmigration is a sensible grouping.
Minor note (pre-existing, out of scope)
- The existing
ocr_idmigration usesmax_length=128while the model declaresmax_length=256. That's unrelated to this PR, but you may want a follow-up to align them.
Nothing blocking; looks good to me.
Summary
As title.