diff options
author | Ernie Miller <ernie@metautonomo.us> | 2010-03-31 15:52:20 -0400 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-03-31 19:22:44 -0300 |
commit | ccf8311123a448fb82a568a57974d58b6b990837 (patch) | |
tree | a76396985c2d1f27f7f24fff2c8688b3565f4bfd /activerecord/lib | |
parent | b3980af8d114b68a5e859ccea7c286f94189f713 (diff) | |
download | rails-ccf8311123a448fb82a568a57974d58b6b990837.tar.gz rails-ccf8311123a448fb82a568a57974d58b6b990837.tar.bz2 rails-ccf8311123a448fb82a568a57974d58b6b990837.zip |
Fix mapping of bigint/smallint/uuid columns in postgresql adapter.
Signed-off-by: Emilio Tagua <miloops@gmail.com>
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb | 3 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb index 046825d43f..6c477e48ce 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb @@ -23,7 +23,8 @@ module ActiveRecord # # +name+ is the column's name, such as <tt>supplier_id</tt> in <tt>supplier_id int(11)</tt>. # +default+ is the type-casted default value, such as +new+ in <tt>sales_stage varchar(20) default 'new'</tt>. - # +sql_type+ is only used to extract the column's length, if necessary. For example +60+ in <tt>company_name varchar(60)</tt>. + # +sql_type+ is used to extract the column's length, if necessary. For example +60+ in <tt>company_name varchar(60)</tt>. + # It will be mapped to one of the standard Rails SQL types in the <tt>type</tt> attribute. # +null+ determines if this column allows +NULL+ values. def initialize(name, default, sql_type = nil, null = true) @name, @sql_type, @null = name, sql_type, null diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index a6042e1382..2395a744a3 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -114,6 +114,12 @@ module ActiveRecord # Object identifier types when /^oid$/ :integer + # UUID type + when /^uuid$/ + :string + # Small and big integer types + when /^(?:small|big)int$/ + :integer # Pass through all types that are not specific to PostgreSQL. else super |