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:
@@ -124,7 +124,7 @@ CREATE TABLE product_category_translations (
|
||||
-- ---------------------------------------------------------------------------
|
||||
CREATE TABLE products (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v7(),
|
||||
canonical_name VARCHAR(255) NOT NULL,
|
||||
canonical_name TEXT NOT NULL,
|
||||
category VARCHAR(50) REFERENCES product_categories(slug),
|
||||
default_unit VARCHAR(20) REFERENCES units(code),
|
||||
barcode TEXT UNIQUE,
|
||||
|
||||
Reference in New Issue
Block a user