summaryrefslogtreecommitdiff
path: root/db/seeds/3_crops.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/seeds/3_crops.rb')
-rw-r--r--db/seeds/3_crops.rb125
1 files changed, 125 insertions, 0 deletions
diff --git a/db/seeds/3_crops.rb b/db/seeds/3_crops.rb
new file mode 100644
index 0000000..2957188
--- /dev/null
+++ b/db/seeds/3_crops.rb
@@ -0,0 +1,125 @@
+# crop_type: 0=leafy greens, 1=fruits, 2=herbs
+
+LEAFY = {
+ nno3: 150,
+ p: 31,
+ k: 210,
+ ca: 90,
+ mg: 24,
+ s: 32,
+ fe: 1.0,
+ mn: 0.25,
+ zn: 0.13,
+ b: 0.16,
+ cu: 0.023,
+ mo: 0.024,
+ nnh4: 5,
+ # keep low for leafy
+ na: 10,
+ cl: 5,
+ si: 20
+}
+
+HERB = LEAFY # Herbs run well on the Cornell leafy recipe
+
+TOMATO = {
+ # CEAC Stage 3 "multi-crop" / mature tomato
+ nno3: 190,
+ p: 47,
+ k: 350,
+ ca: 200,
+ mg: 65,
+ s: 102,
+ fe: 2.0,
+ mn: 0.55,
+ zn: 0.33,
+ b: 0.28,
+ cu: 0.05,
+ mo: 0.05,
+ nnh4: 0,
+ # CEAC recipes are NO3-N; keep NH4 minimal
+ na: 20,
+ cl: 25,
+ si: 20
+}
+
+HOT_PEPPER = {
+ # Mature greenhouse pepper (HortAmericas summary of UA recipes)
+ nno3: 180,
+ p: 50,
+ k: 280,
+ ca: 200,
+ mg: 45,
+ s: 20,
+ fe: 1.0,
+ mn: 0.55,
+ zn: 0.33,
+ b: 0.30,
+ cu: 0.05,
+ mo: 0.05,
+ nnh4: 15,
+ na: 20,
+ cl: 10,
+ si: 20
+}
+
+STRAWBERRY = {
+ # UA strawberry (Yamazaki) emphasizes lower EC; use conservative macros
+ nno3: 120,
+ p: 30,
+ k: 200,
+ ca: 120,
+ mg: 35,
+ s: 50,
+ fe: 1.5,
+ mn: 0.50,
+ zn: 0.20,
+ b: 0.30,
+ cu: 0.05,
+ mo: 0.05,
+ nnh4: 5,
+ na: 10,
+ cl: 5,
+ si: 20
+}
+
+RASPBERRY = {
+ # Sparse data; align with strawberry but a touch higher vigor
+ nno3: 140,
+ p: 35,
+ k: 230,
+ ca: 150,
+ mg: 40,
+ s: 50,
+ fe: 1.5,
+ mn: 0.50,
+ zn: 0.20,
+ b: 0.30,
+ cu: 0.05,
+ mo: 0.05,
+ nnh4: 5,
+ na: 15,
+ cl: 5,
+ si: 20
+}
+
+[
+ [ "lettuce", 0, LEAFY ],
+ [ "kale", 0, LEAFY ],
+ [ "chinese cabbage", 0, LEAFY ],
+ [ "tomatoes", 1, TOMATO ],
+ [ "raspberries", 1, RASPBERRY ],
+ [ "strawberries", 1, STRAWBERRY ],
+ [ "hot peppers", 1, HOT_PEPPER ],
+ [ "parsley", 2, HERB ],
+ [ "chives", 2, HERB ],
+ [ "italian basil", 2, HERB ],
+ [ "dill", 2, HERB ]
+].each do |name, type, nutrient_requirements|
+ Crop.find_or_create_by!(name: name) do |c|
+ c.crop_type = type
+ c.attributes = nutrient_requirements
+ end
+end
+
+puts "Crops: #{Crop.count}"
Copyright 2019--2025 Marius PETER