aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-07-04 18:51:02 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-07-04 18:51:02 +0000
commit4160b518a82bcaa84e0e3125b4947b2dc3837fa3 (patch)
treedef4e797e1834c65864498509ea98edd7dad7745 /activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
parent452442dde8e8ea5949c387ea5c78387bff330f2a (diff)
downloadrails-4160b518a82bcaa84e0e3125b4947b2dc3837fa3.tar.gz
rails-4160b518a82bcaa84e0e3125b4947b2dc3837fa3.tar.bz2
rails-4160b518a82bcaa84e0e3125b4947b2dc3837fa3.zip
Added new Migrations framework for describing schema transformations in a way that can be easily applied across multiple databases #1604 [Tobias Luetke]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1672 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index 66cbe3a58b..3d6550ea9a 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -60,6 +60,27 @@ module ActiveRecord
# * <tt>:encoding</tt> -- An optional client encoding that is using in a SET client_encoding TO <encoding> call on connection.
# * <tt>:min_messages</tt> -- An optional client min messages that is using in a SET client_min_messages TO <min_messages> call on connection.
class PostgreSQLAdapter < AbstractAdapter
+
+ def native_database_types
+ {
+ :primary_key => "serial primary key",
+ :string => { :name => "character varying", :limit => 255 },
+ :text => { :name => "text" },
+ :integer => { :name => "integer" },
+ :float => { :name => "float" },
+ :datetime => { :name => "timestamp" },
+ :timestamp => { :name => "timestamp" },
+ :time => { :name => "timestamp" },
+ :date => { :name => "date" },
+ :binary => { :name => "bytea" },
+ :boolean => { :name => "boolean"}
+ }
+ end
+
+ def supports_migrations?
+ true
+ end
+
def select_all(sql, name = nil)
select(sql, name)
end