fix(db): widen location and path columns — prevent varchar(255) overflow - #96
Merged
Conversation
…flow events.location and pending_events.location -> Text (unbounded): scrapers pull full-address strings from some sources that exceed 255 chars. traffic_logs.path -> String(500): bots occasionally send very long URLs. PostgreSQL widens VARCHAR to TEXT with a metadata-only operation — no table rewrite, no row locks. Requires alembic upgrade head after deploy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
f7a8b9c0d1e2 was chaining from e6f7a8b9c0d1 but f1a2b3c4d5e6 (add_event_thumbnail_url) had already advanced the head from that revision, creating two heads. Point down_revision at f1a2b3c4d5e6. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
DB alarm firing every scraper run (00:00 and 12:00 UTC):
Root cause
events.locationandpending_events.locationareVARCHAR(255). Some scraped sources return full-address strings (e.g. `Conference Hall, 123 Very Long Street Name, Kadıköy, Istanbul, 34000`) that exceed the limit and cause the insert to fail — the event is silently dropped.traffic_logs.pathis alsoVARCHAR(255)and can overflow when bots hit long URLs.Fix
events.locationVARCHAR(255)TEXTpending_events.locationVARCHAR(255)TEXTtraffic_logs.pathVARCHAR(255)VARCHAR(500)PostgreSQL widens VARCHAR → TEXT as a metadata-only operation (no table rewrite, no row locks beyond the catalog update).
Deploy note
Run after merge:
Test plan
pytest tests/ --ignore=tests/unit/test_image_pipeline.py -m "not integration"passesalembic upgrade headruns without error🤖 Generated with Claude Code