diff --git a/db/migrate/20240306151100_add_common_name_to_plants.rb b/db/migrate/20240306151100_add_common_name_to_plants.rb new file mode 100644 index 0000000..ba79ec6 --- /dev/null +++ b/db/migrate/20240306151100_add_common_name_to_plants.rb @@ -0,0 +1,6 @@ +class AddCommonNameToPlants < ActiveRecord::Migration[7.0] + def change + add_column :plants, :common_name, :string + add_index :plants, :common_name + end +end diff --git a/db/schema.rb b/db/schema.rb index 73d7abf..7b0d858 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2024_03_05_043259) do +ActiveRecord::Schema[7.0].define(version: 2024_03_06_151100) do create_table "families", force: :cascade do |t| t.string "name" t.datetime "created_at", null: false @@ -33,6 +33,8 @@ t.integer "genus_id" t.integer "status_id" t.integer "year_acquired" + t.string "common_name" + t.index ["common_name"], name: "index_plants_on_common_name" t.index ["name"], name: "index_plants_on_name", unique: true end