summaryrefslogtreecommitdiff
path: root/db/migrate/20250823142858_create_rafts.rb
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2025-08-24 20:29:54 +0200
committerMarius Peter <marius.peter@tutanota.com>2025-08-24 20:29:54 +0200
commit52b044d6a4278c229992404ad5801769c2d13363 (patch)
treeb30b34da58f26117c035391d09366b190350b1e3 /db/migrate/20250823142858_create_rafts.rb
First commit.
Vive le Castel Peter !
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