好吧,我犯了一个巨大的错误,并在本地删除了几个迁移(现在我知道得更好了)。这已成为一个问题,因为现在当我尝试部署到 heroku 时,我收到以下错误:
Running `rake db:migrate` attached to terminal... up, run.3430
rake aborted!
Multiple migrations have the name CreateScores
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/migration.rb:978:in `validate'
起初这让我感到惊讶,因为我只有一个名为“创建分数”的迁移 - 但后来我注意到了这一点:
Drews-MacBook-Pro:quiz drewwyatt$ rake db:migrate:status
database: /Users/drewwyatt/Sites/Ruby/Rails/quiz/db/development.sqlite3
Status Migration ID Migration Name
--------------------------------------------------
up 20130828212225 Create answers
up 20130828212306 Create questions
up 20130829210727 Create quizzes
up 20130829211302 Remove quiz id from question
up 20130829212349 Create assignments
up 20130829234338 Create employees
up 20130829234541 Add role and active to employee
up 20130830032801 ********** NO FILE **********
up 20130902183412 ********** NO FILE **********
up 20130902183530 Create scores
up 20130902230036 Add indexes to score
up 20130904210011 Create positions
up 20130904212007 Add position to employee
up 20130905161805 Create quiz assignments
我的假设是已删除的迁移之一也被命名为“创建分数”。所以我的问题是,我怎样才能摆脱 2 个已删除的迁移?