small medium large xlarge

Thm_0888_pragsmall
18 Jan 2008, 11:28
Simon Krollpfeifer (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
31 Jan 2008, 22:58
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_pragsmall
02 Feb 2008, 17:02
Simon Krollpfeifer (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

</code>

Generic-user-small
02 Mar 2008, 15:42
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_pragsmall
30 Jul 2008, 08:02
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.

bq. rake db:migrate version=2 rake db:migrate

You must be logged in to comment