summaryrefslogtreecommitdiff
path: root/db/migrate/20250901112954_rename_crops_to_nutrient_profiles.rb
blob: 5b46df19bf7d0317e28e779a17bf264ca218283d (plain)
1
2
3
4
5
6
7
8
9
10
class RenameCropsToNutrientProfiles < ActiveRecord::Migration[8.0]
  def change
    rename_table :crops, :nutrient_profiles

    rename_column :rafts, :crop_id, :crop_nutrient_need_id
    add_index :rafts, :crop_nutrient_need_id unless index_exists?(:rafts, :crop_nutrient_need_id)

    remove_column :nutrient_profiles, :crop_type
  end
end
Copyright 2019--2025 Marius PETER