Permalink
Browse files

Use timestamp migrations

  • Loading branch information...
1 parent 8f9b627 commit 0ad2955dc7aca6add4d1ec33e9ce8efdf62261f9 Jesse Farmer committed Jul 28, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/generators/sequel.rb
View
3 lib/generators/sequel.rb
@@ -26,7 +26,8 @@ def migration_exists?(dirname, file_name) #:nodoc:
# Implement the required interface for Rails::Generators::Migration.
#
def self.next_migration_number(dirname) #:nodoc:
- "%.3d" % (current_migration_number(dirname) + 1)
+ next_migration_number = current_migration_number(dirname) + 1
+ [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
end
end

0 comments on commit 0ad2955

Please sign in to comment.