aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2011-10-20 17:32:34 +1100
committerRyan Bigg <radarlistener@gmail.com>2011-10-20 17:32:48 +1100
commit13e6f0cea83b2699e76b4f21ff87b267514d18d6 (patch)
tree16aad8a50b74b76dde3276f321995663e14017bf
parent3e2d35b05006099163f6492019536bbfa1d82509 (diff)
downloadrails-13e6f0cea83b2699e76b4f21ff87b267514d18d6.tar.gz
rails-13e6f0cea83b2699e76b4f21ff87b267514d18d6.tar.bz2
rails-13e6f0cea83b2699e76b4f21ff87b267514d18d6.zip
[engines guide] some fixes for the author id migration including proof of not copying over other migrations again
-rw-r--r--railties/guides/source/engines.textile14
1 files changed, 10 insertions, 4 deletions
diff --git a/railties/guides/source/engines.textile b/railties/guides/source/engines.textile
index 5a12896b8e..0688dc4c99 100644
--- a/railties/guides/source/engines.textile
+++ b/railties/guides/source/engines.textile
@@ -450,10 +450,10 @@ By defining that the +author+ association's object is represented by the +User+
To generate this new column, run this command within the engine:
<shell>
-$ rails g migration add_author_to_blorgh_posts author:references
+$ rails g migration add_author_id_to_blorgh_posts author_id:integer
</shell>
-NOTE: Due to the migration's name, Rails will automatically know that you want to add a column to a specific table and write that into the migration for you. You don't need to tell it any more than this.
+NOTE: Due to the migration's name and the column specification after it, Rails will automatically know that you want to add a column to a specific table and write that into the migration for you. You don't need to tell it any more than this.
This migration will need to be run on the application. To do that, it must first be copied using this command:
@@ -461,9 +461,15 @@ This migration will need to be run on the application. To do that, it must first
$ rake blorgh:install:migrations
</shell>
-NOTE: Notice here that only _one_ migration was copied over here. This is because the first two migrations were copied over the first time this command was run.
+Notice here that only _one_ migration was copied over here. This is because the first two migrations were copied over the first time this command was run.
-And then migrated using this command:
+<shell>
+ NOTE: Migration [timestamp]_create_blorgh_posts.rb from blorgh has been skipped. Migration with the same name already exists.
+ NOTE: Migration [timestamp]_create_blorgh_comments.rb from blorgh has been skipped. Migration with the same name already exists.
+ Copied migration [timestamp]_add_author_id_to_blorgh_posts.rb from blorgh
+</shell>
+
+Run this migration using this command:
<shell>
$ rake db:migrate