Repository navigation
feat(feeds): English feed name unique per country, not library-wide - #123
Merged
Merged
Conversation
The same forage has the same English name in several countries, so the library-wide unique name rejected real CLIMDES rows (13 of 187 in the last Test sync). Names are now unique within a country, compared as before (lowercase, trimmed, whitespace collapsed); local names already follow this rule (PR #104). - Migration f3a4b5c6d7e8: creates uq_feeds_country_fd_name_norm on (fd_country_id, normalized fd_name) NULLS NOT DISTINCT, then drops uq_feeds_fd_name_norm. Upgrade can't fail on data; downgrade refuses while a name is used in more than one country and lists them. - FeedRepository.get_by_name takes the country. - Feed sync / file upload: name checked in the row's country; a row that would move a feed into a country where its name is taken fails with a clear reason; messages name the country. - Admin Add Feed: country required (a blank one used to create a feed with no country), then the name is checked in that country. Edit Feed: checked in the feed's own fd_country_id. - models.py and schema_compare.py follow the new index; drift check = 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
satishbagali
enabled auto-merge
November 4, 2026 12:11
Aiyappa-DigitalGreen
approved these changes
Nov 4, 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.
Why
The same forage has the same English name in several countries. The library-wide unique feed name (PR #55) rejected real CLIMDES rows: 13 of 187 in the last Test sync (2026-10-31). Names are now unique within a country; the same name may be used in different countries. Local names already follow this rule (PR #104).
Comparison is unchanged: lowercase, trimmed, whitespace (incl. no-break space) collapsed.
What changes
f3a4b5c6d7e8(aftere2f3a4b5c6d7)uq_feeds_country_fd_name_normon (fd_country_id, normalizedfd_name)NULLS NOT DISTINCT, then dropsuq_feeds_fd_name_norm, in one transaction. Upgrade can't fail on data (the old rule is stricter). Downgrade refuses while a name is used in more than one country and lists themmodels.py,schema_compare.pyFeedRepository.get_by_nameNone= feeds without a country)run-from-filePOST /v1/admin/add-feedfd_country_name→ 400 "Country is required" (it used to create a feed with no country). Name checked in that countryPUT /v1/admin/update-feed/{id}fd_country_idNo request/response schema change.
Frontend impact
Deploy plan
deploy_test.sh; index swap only). Until N8 + N5 are live, hold cross-country names on Test: no Sync now, no file upload, no same-name Add Feed in another country. Test's feed-sync scheduler is off.e2f3a4b5c6d7) is obsolete; re-export before the cut-off.Tests (local)
tests/unitpg_get_indexdefequalsschema_compare.pyschema_drift_check --freshtests/integration/test_schema_alignment.pyrun_file_upload_import🤖 Generated with Claude Code