Although there is the undocumented `native_database_types` method that 
returns a hash in each ActiveRecord adapter included in Rails, e.g.:

def native_database_types #:nodoc:
  NATIVE_DATABASE_TYPES
end

If you use the add_reference/add_belongs_to methods in a migration, they 
use the integer type rather than the primary_key type for foreign_keys, 
which is correct since the primary key type can define autoincrement, 
however you want the foreign key column type itself (e.g. integer, etc.) to 
match the primary key's type, so it seems like there should be another 
foreign_key type defined in each adapter. This way you could actually get 
the foreign_key type from the adapter in the add_reference/add_belongs_to 
methods and wouldn't need to instead use add_column as a workaround.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to