From 24c3599cc0f9987d48f2f1c4fe85fc84a6be3d31 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Thu, 13 Oct 2005 04:12:32 +0000 Subject: Support using different database adapters for development and test with ActiveRecord::Base.schema_format = :ruby git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2549 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/CHANGELOG | 2 ++ activerecord/lib/active_record/base.rb | 9 +++++++++ 2 files changed, 11 insertions(+) (limited to 'activerecord') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index b0947a800d..8aa05e88ce 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Add ActiveRecord::Base.schema_format setting which specifies how databases should be dumped [Sam Stephenson] + * Optimize postgresql selects. [skaes@web.de] * Update DB2 adapter. #2206. [contact@maik-schmidt.de] diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index b28247769f..3f0201a202 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -310,6 +310,15 @@ module ActiveRecord #:nodoc: # mode, because the methods would be regenerated on each request. cattr_accessor :generate_read_methods @@generate_read_methods = true + + # Specifies the format to use when dumping the database schema with Rails' + # Rakefile. If :sql, the schema is dumped as (potentially database- + # specific) SQL statements. If :ruby, the schema is dumped as an + # ActiveRecord::Schema file which can be loaded into any database that + # supports migrations. Use :ruby if you want to have different database + # adapters for, e.g., your development and test environments. + cattr_accessor :schema_format + @@schema_format = :sql class << self # Class methods # Find operates with three different retrieval approaches: -- cgit v1.2.3