<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,7 @@
 *2.1.1 (next release)*
 
+* Set config.active_record.timestamped_migrations = false to have migrations with numeric prefix instead of UTC timestamp. #446. [Andrew Stone, Nik Wakelin]
+
 * Fixed that create database statements would always include &quot;DEFAULT NULL&quot; (Nick Sieger) [#334]
 
 * change_column_default preserves the not-null constraint.  #617 [Tarmo T&#228;nav]</diff>
      <filename>activerecord/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -439,6 +439,10 @@ module ActiveRecord #:nodoc:
     cattr_accessor :schema_format , :instance_writer =&gt; false
     @@schema_format = :ruby
 
+    # Specify whether or not to use timestamps for migration numbers
+    cattr_accessor :timestamped_migrations , :instance_writer =&gt; false
+    @@timestamped_migrations = true
+
     # Determine whether to store the full constant name including namespace when using STI
     superclass_delegating_accessor :store_full_sti_class
     self.store_full_sti_class = false</diff>
      <filename>activerecord/lib/active_record/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -238,6 +238,22 @@ module ActiveRecord
   # lower than the current schema version: when migrating up, those
   # never-applied &quot;interleaved&quot; migrations will be automatically applied, and
   # when migrating down, never-applied &quot;interleaved&quot; migrations will be skipped.
+  # 
+  # == Timestamped Migrations
+  #
+  # By default, Rails generates migrations that look like:
+  #
+  #    20080717013526_your_migration_name.rb
+  #
+  # The prefix is a generation timestamp (in UTC).
+  #
+  # If you'd prefer to use numeric prefixes, you can turn timestamped migrations
+  # off by setting:
+  #
+  #    config.active_record.timestamped_migrations = false
+  # 
+  # In environment.rb.
+  #
   class Migration
     @@verbose = true
     cattr_accessor :verbose</diff>
      <filename>activerecord/lib/active_record/migration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -57,6 +57,17 @@ module Rails
         end
 
         protected
+          def current_migration_number
+            Dir.glob(&quot;#{RAILS_ROOT}/#{@migration_directory}/[0-9]*_*.rb&quot;).inject(0) do |max, file_path|
+              n = File.basename(file_path).split('_', 2).first.to_i
+              if n &gt; max then n else max end
+            end
+          end
+             
+          def next_migration_number
+            current_migration_number + 1
+          end
+               
           def migration_directory(relative_path)
             directory(@migration_directory = relative_path)
           end
@@ -70,7 +81,11 @@ module Rails
           end
 
           def next_migration_string(padding = 3)
-            Time.now.utc.strftime(&quot;%Y%m%d%H%M%S&quot;)
+            if ActiveRecord::Base.timestamped_migrations
+              Time.now.utc.strftime(&quot;%Y%m%d%H%M%S&quot;)
+            else
+              &quot;%.#{padding}d&quot; % next_migration_number
+            end
           end
 
           def gsub_file(relative_destination, regexp, *args, &amp;block)</diff>
      <filename>railties/lib/rails_generator/commands.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>af92dc53a830a4639d38df79048f1a30a89dd38a</id>
    </parent>
  </parents>
  <author>
    <name>Michael Koziarski</name>
    <email>michael@koziarski.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/af3f2aad7ecb31a6e1d09f06775cb33b4ad64d91</url>
  <id>af3f2aad7ecb31a6e1d09f06775cb33b4ad64d91</id>
  <committed-date>2008-07-30T09:33:43-07:00</committed-date>
  <authored-date>2008-07-30T09:33:43-07:00</authored-date>
  <message>Set config.active_record.timestamped_migrations = false to have migrations with numeric prefix instead of UTC timestamp. [#446 state:resolved]

Signed-off-by: Pratik Naik &lt;pratiknaik@gmail.com&gt;</message>
  <tree>9639dacc4d9874a12ed425a0f459f40903cc57f8</tree>
  <committer>
    <name>Michael Koziarski</name>
    <email>michael@koziarski.com</email>
  </committer>
</commit>
