summaryrefslogtreecommitdiff
path: root/db/schema.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/schema.rb')
-rw-r--r--db/schema.rb130
1 files changed, 130 insertions, 0 deletions
diff --git a/db/schema.rb b/db/schema.rb
new file mode 100644
index 0000000..b5f2e03
--- /dev/null
+++ b/db/schema.rb
@@ -0,0 +1,130 @@
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# This file is the source Rails uses to define your schema when running `bin/rails
+# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
+# be faster and is potentially less error prone than running all of your
+# migrations from scratch. Old migrations may fail to apply correctly if those
+# migrations use external dependencies or application code.
+#
+# It's strongly recommended that you check this file into your version control system.
+
+ActiveRecord::Schema[8.0].define(version: 2025_08_24_163257) do
+ create_table "beds", force: :cascade do |t|
+ t.integer "location", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["location"], name: "index_beds_on_location", unique: true
+ end
+
+ create_table "crops", force: :cascade do |t|
+ t.string "name"
+ t.integer "crop_type", default: 1, null: false
+ t.float "nno3"
+ t.float "p"
+ t.float "k"
+ t.float "ca"
+ t.float "mg"
+ t.float "s"
+ t.float "na"
+ t.float "cl"
+ t.float "si"
+ t.float "fe"
+ t.float "zn"
+ t.float "b"
+ t.float "mn"
+ t.float "cu"
+ t.float "mo"
+ t.float "nnh4"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "fertilizer_components", force: :cascade do |t|
+ t.string "name"
+ t.string "formula"
+ t.float "nno3"
+ t.float "nnh4"
+ t.float "p"
+ t.float "k"
+ t.float "ca"
+ t.float "mg"
+ t.float "s"
+ t.float "na"
+ t.float "cl"
+ t.float "si"
+ t.float "fe"
+ t.float "zn"
+ t.float "b"
+ t.float "mn"
+ t.float "cu"
+ t.float "mo"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "fertilizer_compositions", force: :cascade do |t|
+ t.integer "fertilizer_product_id", null: false
+ t.integer "fertilizer_component_id", null: false
+ t.decimal "percent_w", precision: 6, scale: 3, null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["fertilizer_component_id"], name: "index_fertilizer_compositions_on_fertilizer_component_id"
+ t.index ["fertilizer_product_id"], name: "index_fertilizer_compositions_on_fertilizer_product_id"
+ end
+
+ create_table "fertilizer_products", force: :cascade do |t|
+ t.string "name", null: false
+ t.decimal "purity", precision: 5, scale: 2, default: "100.0", null: false
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["name"], name: "index_fertilizer_products_on_name", unique: true
+ end
+
+ create_table "nutrient_measurements", force: :cascade do |t|
+ t.date "measured_on"
+ t.float "nno3"
+ t.float "p"
+ t.float "k"
+ t.float "ca"
+ t.float "mg"
+ t.float "s"
+ t.float "na"
+ t.float "cl"
+ t.float "si"
+ t.float "fe"
+ t.float "zn"
+ t.float "b"
+ t.float "mn"
+ t.float "cu"
+ t.float "mo"
+ t.float "nnh4"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["measured_on"], name: "index_nutrient_measurements_on_measured_on", unique: true
+ end
+
+ create_table "nutrients", force: :cascade do |t|
+ t.string "formula"
+ t.string "name"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ end
+
+ create_table "rafts", force: :cascade do |t|
+ t.integer "bed_id", null: false
+ t.integer "location", null: false
+ t.integer "crop_id"
+ t.datetime "created_at", null: false
+ t.datetime "updated_at", null: false
+ t.index ["bed_id", "location"], name: "index_rafts_on_bed_id_and_location", unique: true
+ t.index ["bed_id"], name: "index_rafts_on_bed_id"
+ t.index ["crop_id"], name: "index_rafts_on_crop_id"
+ end
+
+ add_foreign_key "fertilizer_compositions", "fertilizer_components"
+ add_foreign_key "fertilizer_compositions", "fertilizer_products"
+ add_foreign_key "rafts", "beds"
+ add_foreign_key "rafts", "crops"
+end
Copyright 2019--2025 Marius PETER