Is it true that Rails needs a single column to uniquely identify a row in table? If yes, doesn''t this limit the database design and disables the use of Rails for legacy databases? /Fredrik -- Posted via http://www.ruby-forum.com/.
"Fredrik Bertilsson" <frebe73@gmail.com> wrote in message news:e6f1507c08d5db29e91a796ca52a666a@ruby-forum.com...> Is it true that Rails needs a single column to uniquely identify a row > in table? If yes, doesn''t this limit the database design and disables > the use of Rails for legacy databases? > > /Fredrikrails doesn''t currently support composite primary keys. Workarounds have been discussed on the list in the past but I don''t have any specific posts for you. Check the archives
It is true except for the habm join tables those do not need them since they are never instanciated as AR objects.(at least thats what my memory is telling me.) On 7/22/06, Fredrik Bertilsson <frebe73@gmail.com> wrote:> Is it true that Rails needs a single column to uniquely identify a row > in table? If yes, doesn''t this limit the database design and disables > the use of Rails for legacy databases? > > /Fredrik > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- Elliott Clark eclark@cc.gatech.edu eclark@nife.us
You can use migrations to add an auto-incrementing id column to your existing tables. - dan -- Dan Kohn <mailto:dan@dankohn.com> <http://www.dankohn.com/> <tel:+1-415-233-1000> On Jul 22, 2006, at 6:55 PM, Elliott Clark wrote:> It is true except for the habm join tables those do not need them > since they are never instanciated as AR objects.(at least thats what > my memory is telling me.) > > On 7/22/06, Fredrik Bertilsson <frebe73@gmail.com> wrote: >> Is it true that Rails needs a single column to uniquely identify a >> row >> in table? If yes, doesn''t this limit the database design and disables >> the use of Rails for legacy databases? >> >> /Fredrik >> >> -- >> Posted via http://www.ruby-forum.com/. >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > > -- > Elliott Clark > eclark@cc.gatech.edu > eclark@nife.us > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
On 7/23/06, Elliott Clark <eclark@cc.gatech.edu> wrote:> It is true except for the habm join tables those do not need them > since they are never instanciated as AR objects.(at least thats what > my memory is telling me.)Except that habtm and join tables have been all but outlawed in the RoR world. -- -------------- Jon Gretar Borgthorsson http://www.jongretar.net/
> Is it true that Rails needs a single column to uniquely identify a row > in table? If yes, doesn''t this limit the database design and disables > the use of Rails for legacy databases?Try http://compositekeys.rubyforge.org - its alpha code, but play with it and tell me where the holes are so I can fix them for you. Cheers Nic -- Posted via http://www.ruby-forum.com/.
Reasonably Related Threads
- [somewhat OT] Apache config for Rails + ColdFusion + PHP
- Is there a huge performance difference between using multiple periodically_call_remote functions or one?
- faster? database search or rewriting objects
- Who owns the web application after it code''s distributed?
- LoginGenerator Killing Me ;)