diff options
| author | Marius Peter <dev@marius-peter.com> | 2025-11-20 11:33:39 +0100 |
|---|---|---|
| committer | Marius Peter <dev@marius-peter.com> | 2025-11-20 11:33:39 +0100 |
| commit | c0c81afb346254893457c33e3a9eb9081d13332a (patch) | |
| tree | 759b5b1f8dd4a101062b8e678f100f91eb4eea21 /models | |
| parent | 09ba1e517c12561e25c9c36796029004eaa3f578 (diff) | |
Add crop-id guard.
Diffstat (limited to 'models')
| -rw-r--r-- | models/crop-requirement.rkt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/models/crop-requirement.rkt b/models/crop-requirement.rkt index 6ddf1aa..2048091 100644 --- a/models/crop-requirement.rkt +++ b/models/crop-requirement.rkt @@ -28,9 +28,10 @@ "nutrient.rkt" "crop.rkt") -;; Instances of this struct are persisted in the crop_requirements table. -(struct crop-requirement (id profile crop-id) #:transparent) - +(struct crop-requirement (id profile crop-id nutrient-values) + #:transparent + #:guard (λ (id profile crop-id nutrient-values _) + (values id profile (if (sql-null? crop-id) #f crop-id) nutrient-values))) ;; CREATE |