문제

If I have two migration files:

20110414132423_insert_bulk_data.rb #1st
20111122105951_add_some_columns.rb #2nd

and I run rake db:migrate, is the 1st one run firstly since it has older timestamp??

Since I am in the middle of someone else's code, he made the 20110414132423_insert_bulk_data migration which insert data to table, but this migration file complains an unknown column in the table, then I found the missing column is defined in the 2nd 20111122105951_add_some_columns.rb migration file which has newer timestamp...

How can I get rid of this?

도움이 되었습니까?

해결책

Shortly, yes. The timestamp is used to order migrations and to navigate between them. See more here

다른 팁

  1. delete this migrations
  2. generate two new migrations in the way you need to run
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top