I tried to add a column to a table after a specific column in the table. Here is what I did:
rails generate migration add_reaction_id_to_patient_allergies reaction_id: integer :after => 'patient_id'
Here is what my migration file looks like:
class AddReactionIdToPatientAllergies < ActiveRecord::Migration
def change
add_column :patient_allergies, :reaction_id, :string
add_column :patient_allergies, :integer, :string
add_column :patient_allergies, :, :after
add_column :patient_allergies, :=, :string
end
end
I dont think the command went well. I see an '=' in the above file. I do not think it should be there. Can someone tell me if I missed anything?
If so , how do I undo the above?