fix: change products.canonical_name to TEXT, trim whitespace on import
VARCHAR(255) was too narrow for some OpenFoodFacts product names. Switching to TEXT removes the length constraint entirely. Also trim whitespace from resolved canonical names during import. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -209,9 +209,9 @@ func run() error {
|
||||
}
|
||||
|
||||
// Resolve canonical name: prefer English, fall back to any language.
|
||||
canonicalName := record.ProductNameEN
|
||||
canonicalName := strings.TrimSpace(record.ProductNameEN)
|
||||
if canonicalName == "" {
|
||||
canonicalName = record.ProductName
|
||||
canonicalName = strings.TrimSpace(record.ProductName)
|
||||
}
|
||||
|
||||
// Apply filter rules.
|
||||
|
||||
Reference in New Issue
Block a user