diff options
| author | Marius Peter <dev@marius-peter.com> | 2025-12-13 22:42:42 +0100 |
|---|---|---|
| committer | Marius Peter <dev@marius-peter.com> | 2025-12-13 22:42:42 +0100 |
| commit | 21d5ace6a0f90c4e7e6fd6a19cae4cfce7d45c97 (patch) | |
| tree | d7276cc0890bf555885bcc696abf449df7e67638 | |
| parent | 6801e7e1363ab86ccfdce382ba40ac70f36caf21 (diff) | |
Permit empty strings for the brand name.
This allows the canonical-name/brand-name database uniqueness
constraint.
| -rw-r--r-- | models/fertilizer-product.rkt | 5 |
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)) |