我无法迁移,出现此错误:
StandardError:发生错误,此迁移和所有后续迁移均已取消:
原因:
ArgumentError:参数数量错误(给定 2,预期 1) /home/ciaranmurphy/cashanalytics/db/migrate/20130614160852_add_first_name_last_name_user_type_values_to_user.rb:3 > :in区块(2 级),位于change' /home/ciaranmurphy/cashanalytics/lib/tasks/multitenant.rake:32:in
'
/home/ciaranmurphy/cashanalytics/lib/tasks/multitenant.rake:18:inwith_public' /home/ciaranmurphy/cashanalytics/lib/tasks/multitenant.rake:16:inblock in migrate_each' /home/ciaranmurphy/cashanalytics/app/services/tenant.rb:132:in
块中migrate_each' /home/ciaranmurphy/cashanalytics/lib/tasks/multitenant.rake:31:in
'
任务:TOP => db:migrate
(通过使用 --trace 运行任务查看完整跟踪)
我尝试了迁移和跟踪,但没有解决问题
没有实际的迁移文件很难说,但请确保您的
cashanalytics/db/migrate/20130614160852_add_first_name_last_name_user_type_values_to_user.rb
文件看起来像这样:
class AddFirstNameLastNameUserTypeValuesToUser < ActiveRecord::Migration[7.1]
def change
add_column :user, :first_name, :string
add_column :user, :last_name, :string
# guessing the data type here.May also be a reference.
add_column :user, :user_type, :integer
end
end