diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-12 05:33:18 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-12 05:33:18 +0000 |
commit | a16528f715f49531c6013dde741fcba8182202b6 (patch) | |
tree | 6662c2a59e0793e2f9c606baa967ef2b66fdafb8 /activerecord/lib/active_record/connection_adapters | |
parent | 9105cd10640c06b53536d99211ef8183b1fa7705 (diff) | |
download | rails-a16528f715f49531c6013dde741fcba8182202b6.tar.gz rails-a16528f715f49531c6013dde741fcba8182202b6.tar.bz2 rails-a16528f715f49531c6013dde741fcba8182202b6.zip |
Added dump of schema version to the db_structure_dump task for databases that support migrations #1835 [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2215 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index e0c880780e..cbc8e7c273 100755 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -374,7 +374,17 @@ module ActiveRecord # Schema has been intialized end end - + + def dump_schema_information + begin + if (current_schema = ActiveRecord::Migrator.current_version) > 0 + return "INSERT INTO schema_info (version) VALUES (#{current_schema});" + end + rescue ActiveRecord::StatementInvalid + # No Schema Info + end + end + def create_table(name, options = {}) table_definition = TableDefinition.new(self) table_definition.primary_key(options[:primary_key] || "id") unless options[:id] == false |