From d9ce4fa7ac21dd3f623defa3cb1ac1a87b670ebe Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Wed, 26 Dec 2012 15:24:22 -0500 Subject: Note about migration timestamps. We should mention that the ordering matters with regards to timestamps, and not imply that it's just for uniqueness purposes. Closes #8610. --- guides/source/migrations.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'guides/source') diff --git a/guides/source/migrations.md b/guides/source/migrations.md index 62b70b5571..f2aa72492f 100644 --- a/guides/source/migrations.md +++ b/guides/source/migrations.md @@ -108,7 +108,9 @@ of the migration. The name of the migration class (CamelCased version) should match the latter part of the file name. For example `20080906120000_create_products.rb` should define class `CreateProducts` and `20080906120001_add_details_to_products.rb` should define -`AddDetailsToProducts`. +`AddDetailsToProducts`. Rails uses this timestamp to determine which migration +should be run and in what order, so if you're copying a migration from another +application or generate a file yourself, be aware of its position in the order. Of course, calculating timestamps is no fun, so Active Record provides a generator to handle making it for you: -- cgit v1.2.3