summaryrefslogtreecommitdiff
path: root/db/migrate/20250823142858_create_rafts.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20250823142858_create_rafts.rb')
-rw-r--r--db/migrate/20250823142858_create_rafts.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/db/migrate/20250823142858_create_rafts.rb b/db/migrate/20250823142858_create_rafts.rb
new file mode 100644
index 0000000..6b7f006
--- /dev/null
+++ b/db/migrate/20250823142858_create_rafts.rb
@@ -0,0 +1,13 @@
+class CreateRafts < ActiveRecord::Migration[8.0]
+ def change
+ create_table :rafts do |t|
+ t.references :bed, null: false, foreign_key: true
+ t.integer :location, null: false
+ t.references :crop, null: true, foreign_key: true
+
+ t.timestamps
+ end
+
+ add_index :rafts, [ :bed_id, :location ], unique: true
+ end
+end
Copyright 2019--2025 Marius PETER