我试图在表中的特定列之后将列添加到表中。 下面是我做的:
rails generate migration add_reaction_id_to_patient_allergies reaction_id: integer :after => 'patient_id'
这里是我的移民文件的样子:
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
我不认为命令进行得很顺利。 我在上述文件中看到一个“=”。 我不认为它应该在那里。 谁能告诉我,如果我错过了什么?
如果是这样,我怎么撤消以上?