public
Fork of wycats/merb-plugins
Description: Merb Plugins: Even more modules to hook up your Merb installation
Homepage: http://www.merbivore.com
Clone URL: git://github.com/myobie/merb-plugins.git
update for ActiveRecord 2.1 migrations

Signed-off-by: Michael S. Klishin <michael@novemberain.com>
shayarnett (author)
Fri Jun 20 07:07:22 -0700 2008
michaelklishin (committer)
Tue Jun 24 13:51:38 -0700 2008
commit  f359ed6f303d94ace7ffefafc133bbb90ed6d440
tree    29b6c43064fa42ab7e3cf1b8c82691e1223e7ea5
parent  a94e9248cbf9d961b9b0de41d238128fc2f0253d
...
16
17
18
19
20
 
21
22
23
...
16
17
18
 
 
19
20
21
22
0
@@ -16,8 +16,7 @@ class DatabaseSessionsMigrationGenerator < Merb::GeneratorBase
0
     m.directory 'schema/migrations'
0
 
0
     # Create stubs
0
- highest_migration = Dir[Dir.pwd+'/schema/migrations/*'].map{|f| File.basename(f) =~ /^(\d+)/; $1}.max
0
- filename = format("%03d_%s", (highest_migration.to_i+1), @name.snake_case)
0
+ filename = format("%03d_%s", Time.now.utc.strftime("%Y%m%d%H%M%S"), @name.snake_case)
0
     m.template "sessions_migration.erb", "schema/migrations/#{filename}.rb"
0
     puts banner
0
 
...
16
17
18
19
20
 
21
22
23
...
16
17
18
 
 
19
20
21
22
0
@@ -16,8 +16,7 @@ class MigrationGenerator < Merb::GeneratorBase
0
       
0
       m.directory "schema/migrations"
0
       
0
- current_migration_number = Dir[Dir.pwd+'/schema/migrations/*'].map{|f| File.basename(f) =~ /^(\d+)/; $1}.max
0
- @migration_file_name = format("%03d_%s", (current_migration_number.to_i+1), model_file_name) + "_migration"
0
+ @migration_file_name = format("%03d_%s", Time.now.utc.strftime("%Y%m%d%H%M%S"), model_file_name) + "_migration"
0
     
0
       @assigns = { :model_file_name => model_file_name,
0
                     :model_attributes => model_attributes,

Comments

    No one has commented yet.