Simply rails 2-rake db:migrate not working

I am back into the simply rails 2 book after reading half of learn to program and I am not getting the read out supposed on page 132 after puting in
rake db:migrate in the the shovell folder… it just produces the same line in paretheses that I started with, but the 001_create_stories.rb file on page 126looks good. Anybody know why the read out is wrong?

Without knowing what the “same line” is, I’ll guess.
Maybe you missed the
:force => true
on page 129?

what I mean is the same line as the prompt line, and like I said I checked the force true line in that file to make sure it read right and it looked correct

So at the prompt
…/shovell> rake db:migrate
(in /path/to/shovell)
and then hangs (or does nothing else)? No error messages?

Does it go back to the prompt

yes it comes right back to same original prompt

Have you checked that the migration hasn’t already been run? Once a migration has been run, if you run the migration again, you get minimal output. It might be worth rolling back to the previous migration and then running the migration again.

I don’t think I know how to check if a migration has been run, how do I do it?

I never got an answer to why db:migrate didn’t work, can somebody review my question and see if they know, I don’t know to check if the migration has been done or not


In the application’s log folder should be a “development.log” file. If you look at that you should find migration info and lots more.

Probably be easier to check the db/schema.rb file. It shows what your database currently looks like, have look and see if the migration you’ve written has already been applied.

below is the file, but I am not really sure what I am looking at, I am guessing it is correct
create_table “stories”, :force => true do |t|
t.string “name”
t.string “link”
t.datetime “created_at”
t.datetime “updated_at”


Except for the version which would be different, yours looks like mine

ActiveRecord::Schema.define(:version => 20080830130129) do

  create_table "stories", :force => true do |t|
    t.string   "name"
    t.string   "link"
    t.datetime "created_at"
    t.datetime "updated_at"


Yeah, so it looks like the migration has already been run.

You write the migration, you run ‘rake db:migrate’, the migrations are applied to the database. ‘rake db:migrate’ then won’t do anything until you create a new migration.

A migration is like a set of instructions of what should be done to a database, so each one is only run once. If you were working in a team, the migrations can be kept with the project and then team members can easily run them against their own databases.

schema.rb then keeps track of what your database looks like (and also lists the number of the latest migration in the :version hash).