diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-12-05 12:13:49 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-12-05 12:13:49 -0800 |
commit | 0c692f4d121792117b6a71e5ed590a31c3b9d12e (patch) | |
tree | 869bf3fb884e55847bf7aa34b4c6b463d1590720 /activerecord/lib/active_record/connection_adapters | |
parent | 2e299fca715b083a60222a85e48f9d3b8dd8ce93 (diff) | |
parent | 94ef7b515b9bd026a0ed67ef7dabbf0b4ab554e3 (diff) | |
download | rails-0c692f4d121792117b6a71e5ed590a31c3b9d12e.tar.gz rails-0c692f4d121792117b6a71e5ed590a31c3b9d12e.tar.bz2 rails-0c692f4d121792117b6a71e5ed590a31c3b9d12e.zip |
Merge branch 'joshsusser-master' into merge
* joshsusser-master:
style cleanup
Add migration history to schema.rb dump
Add metadata to schema_migrations
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/schema.rb
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 8 |
1 files changed, 4 insertions, 4 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 f1e42dfbbe..a470e8de07 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -490,8 +490,8 @@ module ActiveRecord sm_table = ActiveRecord::Migrator.schema_migrations_table_name ActiveRecord::SchemaMigration.order('version').map { |sm| - "INSERT INTO #{sm_table} (version) VALUES ('#{sm.version}');" - }.join "\n\n" + "INSERT INTO #{sm_table} (version, migrated_at, fingerprint, name) VALUES ('#{sm.version}',LOCALTIMESTAMP,'#{sm.fingerprint}','#{sm.name}');" + }.join("\n\n") end # Should not be called normally, but this operation is non-destructive. @@ -512,7 +512,7 @@ module ActiveRecord end unless migrated.include?(version) - execute "INSERT INTO #{sm_table} (version) VALUES ('#{version}')" + ActiveRecord::SchemaMigration.create!(:version => version, :migrated_at => Time.now) end inserted = Set.new @@ -520,7 +520,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}')" + ActiveRecord::SchemaMigration.create!(:version => v, :migrated_at => Time.now) inserted << v end end |