Hi! I'm trying to use a primary key made up of two columns in my model's table. But looking at the docs, it looks like ActiveRecord only supports using one field as primary key. Can anyone point me in a direction of this or verify that it's not supported? Greetings, Gitte W.
on 2006-01-04 01:45
on 2006-01-04 03:03
Composite primary keys are not supported... yet. But keep an eye on Edge Rails. Gitte W. wrote: > Hi! > > I'm trying to use a primary key made up of two columns in my model's > table. > But looking at the docs, it looks like ActiveRecord only supports using > one field as primary key. > > Can anyone point me in a direction of this or verify that it's not > supported? > > Greetings, > Gitte W.
on 2006-02-08 23:49
Hi I'm a total beginner with either Ruby or Rails. I am having the same issue and was also looking for a confirmation on this matter. Since multi-column primary keys are not currrently supported, and the legacy table I have uses four varchar columns as the primary key. As a work-around during prototyping, I created a view that does the following: CREATE VIEW WorkAround AS SELECT f1 + '-' + f2 + '-' + f3 + '-' + f4 AS id FROM LegacyTable It's not perfect but it suffcies for my purposes. By the way, can anybody tell me what happened to http:// manuals.rubyonrails.com?