From 52b044d6a4278c229992404ad5801769c2d13363 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 24 Aug 2025 20:29:54 +0200 Subject: First commit. Vive le Castel Peter ! --- db/migrate/20250823142858_create_rafts.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 db/migrate/20250823142858_create_rafts.rb (limited to 'db/migrate/20250823142858_create_rafts.rb') 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 -- cgit v1.2.3