Index: chapter_1.markdown =================================================================== --- chapter_1.markdown (revision 21) +++ chapter_1.markdown (working copy) @@ -278,7 +278,7 @@ Run the migration - $ rake migrate + $ rake db:migrate == CreatePosts: migrating ============================================ -- create_table(:posts) -> 0.0350s @@ -352,7 +352,7 @@ Run the migration - $ rake migrate + $ rake db:migrate We now have a comments table to keep track of feedback, now we need to associate the posts with our new comments so Rails knows there is a link between them, because when it knows there is a link it creates even more voodoo magic for us. Don't worry, all this voodoo magic is explained in later chapters and is completely de-mystified, but let's live in our fanatasy world for a little longer. Edit the following files to look like: Index: chapter_3.markdown =================================================================== --- chapter_3.markdown (revision 21) +++ chapter_3.markdown (working copy) @@ -210,7 +210,7 @@ In order to actually run this migration we'll use yet another handy tool called 'rake'. Rake allows us to define tasks in Ruby and then execute them. Rails comes with a migration task to run the above migration. Execute this: - $ rake migrate + $ rake db:migrate == CreateArticles: migrating ================================================== -- create_table(:articles) @@ -262,7 +262,7 @@ Now run the migration: - $ rake migrate + $ rake db:migrate == AddExcerptColumnToArticles: migrating =================================== -- add_column("articles", "excerpt", :text) @@ -273,7 +273,7 @@ Run the following to drop the column and revert to version 1 of your schema. - $ rake migrate VERSION=1 + $ rake db:migrate VERSION=1 Sometimes a migration is supposed to be destructive or at least do something that you cannot rollback. In order for Migrations to gracefully handle this you should tell the migration it is non-reversible. You do this by raising an exception: @@ -283,7 +283,7 @@ >>TIP You can test your migrations before you run them on production or development by setting the environment variable RAILS_ENV to test like this if you're on some sort of unix or macosx (use setenv on Windows) - $ RAILS_ENV=test ; rake migrate + $ RAILS_ENV=test ; rake db:migrate >>This comes in handy when testing destructive or irreversible migrations since your test environment is wiped clean every single time anyway. More on test environments later.