Em 06-12-2011 13:23, James B. Byrne escreveu:
On Tue, December 6, 2011 05:28, Rodrigo Rosenfeld Rosas
wrote:

Yes, I was referring exactly to PostgreSQL. Don't you
think that for most associations we would want an index?

I'm proposing creating one unless specified not to. For
example:

t.references :category, create_index: false

Don't you think 'true' should be default for
:create_index?

I would caution against adding such 'invisible'
'enhancements'.  The more so given the wide variability of
DBMS implementations. Better I think to leave everything
having to do with foreign keys off by default and have the
DBA specify case by case exactly which features should be
turned on.

Foreign keys are one of those things that prompt religious
wars and I would rather have Rails avoid adopting one side
or the other as dogma.

You might be right. Anyway, I would be happy if I would have to pass "create_index: true" manually for most foreign keys too.

--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to