Thm_0888_small Simon Krollp... 7 posts

I have a huge problem loading data in the database. I downloaded the file
add_test_data.rb from the code section, and created the file in my depot folder using

ruby script/generate migration add_test_data

After that I copied the content of the downloaded add_test_data into my newly created one.
Everything is mentioned as in the book.
After pasting everyting into 003_add_test_data I type

rake db:migrate

to load the data in the database. Nothing happens. I just get a normal
(in /Users/Simon/work/depot)

following by the prompt.
I have no problem writing data via the browser to my database. So, what am I doing wrong here?

P.S. I am using rails 1.2.6

 
Generic-user-small Mike Fenton 1 post

I had exactly the same problem – solved it by deleted the schema and products tables from MySQL and then issuing

rake db:migrate

Not sure why this worked (the schema table had the right version number in it).

Hope this help.

 
Thm_0888_small Simon Krollp... 7 posts

I figured it out thanks to a friend. The issue was the migrate version of the program. If RonR thinks, that you’re up to date, it does nothing.
So I just have to downgrade the migration version by one and migrate again.
bulletproof version:


rake db:mirgrate VERSION=0
rake db:migrate

 
Generic-user-small will darrah 1 post

Simon if rolling back did not work check that your app/model/product.rb is not causing the data to be refuted. Specifically the pasted data is all .jpg, did you filter for .jpeg?

 
Funnykeybard_small Adam Sims 1 post

I had the same problem with migrating the add_test_data, lucekly, rolling back the version as suggested by Simon worked for me.

rake db:migrate version=2
rake db:migrate

5 posts, 4 voices