rake db:migrate

Subscribe to rake db:migrate 3 posts, 2 voices

 
Avatar jcoffman 19 posts

This happens to be on windows, but I don’t know if it matters. I have a rails app I’m using to teach myself.. I setup a couple migration files to create, then add a column to a table.

I then pulled that code over to another machine, which does have mysql and the right database on it. However, when I run rake db:migrate, I get the below message. It appears that its not running v1 of the migration before trying v2. I thought rake db:migrate was smart enough to rollup to the current version… am I wrong?

(in C:/Dev/dbtutor) 2 User: migrating ======================================================== —add_column(:users, :email_address, :string) rake aborted! Mysql::Error: #42S02Table ‘testdb.users’ doesn’t exist: ALTER TABLE `users` ADD `email_add ress` varchar(255)

(See full trace by running task with—trace)

 
Avatar RJ 12 posts

Let’s see your migrations so we can see if anything looks out of the ordinary.

 
Avatar jcoffman 19 posts

i changed my approach and it worked out… just generated that scaffolding and starting building from there. thanks for the offer though.