aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorJosh Susser <josh@hasmanythrough.com>2010-12-01 11:56:21 -0800
committerJosh Susser <josh@hasmanythrough.com>2010-12-01 12:01:56 -0800
commita49de9811ab4cf39fbdb5a6941ee003b1e489184 (patch)
tree36f972c751e769e460acccc8f017408acf800bdc /activerecord/lib/active_record
parentb07c2c0fd3130bb69cf8d846e46762a7c3972107 (diff)
downloadrails-a49de9811ab4cf39fbdb5a6941ee003b1e489184.tar.gz
rails-a49de9811ab4cf39fbdb5a6941ee003b1e489184.tar.bz2
rails-a49de9811ab4cf39fbdb5a6941ee003b1e489184.zip
tests mostly pass
adjust to work with instance-based migations migrated_at can't be null why must people have last names? it's killing me!
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb4
-rw-r--r--activerecord/lib/active_record/schema.rb2
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)