« Return to Thread: Get a list of all foreign keys (with their respective tables

Re: Get a list of all foreign keys (with their respective tables

by Adam Akhtar-2 :: Rate this Message:

Reply to Author | View in Thread


Roy Pardee wrote:
> I'm no guru, so I'll give the non-guru answer.  If it works, it's
> sensible. ;-)
>
> Seriously, if you wanted to make it a bit more db-agnostic (is that a
> goal?) you could use the .tables(), .columns() and .indexes() methods on
> ActiveRecord::Base.connection to get your list of those things.  Of
> course if that's a goal, you'll want to switch over to add_index as
> well, instead of doing the raw sql thing.

That sounds sensible :)  I can't see us ever switching from mysql but
that does seem much nicer.  I didn't know about those, thanks!
--
Posted via http://www.ruby-forum.com/.

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

 « Return to Thread: Get a list of all foreign keys (with their respective tables