From 21d5ace6a0f90c4e7e6fd6a19cae4cfce7d45c97 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sat, 13 Dec 2025 22:42:42 +0100 Subject: Permit empty strings for the brand name. This allows the canonical-name/brand-name database uniqueness constraint. --- models/fertilizer-product.rkt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'models/fertilizer-product.rkt') diff --git a/models/fertilizer-product.rkt b/models/fertilizer-product.rkt index a002ad4..e79a707 100644 --- a/models/fertilizer-product.rkt +++ b/models/fertilizer-product.rkt @@ -28,10 +28,7 @@ (struct fertilizer-product (id canonical-name brand-name nutrient-values) #:transparent #:guard (λ (id canonical-name brand-name nutrient-values _) - (values id - canonical-name - (if (or (sql-null? brand-name) (= (string-length brand-name) 0)) #f brand-name) - nutrient-values)) + (values id canonical-name (if (sql-null? brand-name) #f brand-name) nutrient-values)) #:property prop:custom-write (λ (v out _mode) (fprintf out "Fertilizer #~a\n" (fertilizer-product-id v)) -- cgit v1.2.3