summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Peter <dev@marius-peter.com>2025-12-13 22:42:42 +0100
committerMarius Peter <dev@marius-peter.com>2025-12-13 22:42:42 +0100
commit21d5ace6a0f90c4e7e6fd6a19cae4cfce7d45c97 (patch)
treed7276cc0890bf555885bcc696abf449df7e67638
parent6801e7e1363ab86ccfdce382ba40ac70f36caf21 (diff)
Permit empty strings for the brand name.
This allows the canonical-name/brand-name database uniqueness constraint.
-rw-r--r--models/fertilizer-product.rkt5
1 files changed, 1 insertions, 4 deletions
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))
Copyright 2019--2026 Marius PETER