Single id column

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

“Fredrik B.” [email protected] wrote
in message news:[email protected]

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

rails 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 B. [email protected] wrote:

[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Elliott C.
[email protected]
[email protected]

You can use migrations to add an auto-incrementing id column to your
existing tables.

        - dan


Dan K. mailto:[email protected]
http://www.dankohn.com/ tel:+1-415-233-1000

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

On 7/23/06, Elliott C. [email protected] 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.