diff options
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 4 | ||||
-rw-r--r-- | activerecord/lib/active_record/schema.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index ccb6fe3be2..de7d358df9 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -464,7 +464,7 @@ module ActiveRecord end unless migrated.include?(version) - execute "INSERT INTO #{sm_table} (version) VALUES ('#{version}')" + execute "INSERT INTO #{sm_table} (version,migrated_at) VALUES ('#{version}','#{Time.now.to_s(:db)}')" end inserted = Set.new @@ -472,7 +472,7 @@ module ActiveRecord if inserted.include?(v) raise "Duplicate migration #{v}. Please renumber your migrations to resolve the conflict." elsif v < version - execute "INSERT INTO #{sm_table} (version) VALUES ('#{v}')" + execute "INSERT INTO #{sm_table} (version,migrated_at) VALUES ('#{v}','#{Time.now.to_s(:db)}')" inserted << v end end diff --git a/activerecord/lib/active_record/schema.rb b/activerecord/lib/active_record/schema.rb index 4b846f2e27..9a47fd3b84 100644 --- a/activerecord/lib/active_record/schema.rb +++ b/activerecord/lib/active_record/schema.rb @@ -55,7 +55,7 @@ module ActiveRecord assume_migrated_upto_version(info[:version], schema.migrations_path) unless info[:version].blank? end - def self.migration(version, name="", options={}) + def migration(version, name="", options={}) name, options = "", name if name.is_a?(Hash) table = Arel::Table.new(ActiveRecord::Migrator.schema_migrations_table_name) |