Ruby on Rails Monday, November 28, 2011

On Sun, Nov 27, 2011 at 6:27 PM, Seb <sebastianthegreatful@gmail.com> wrote:

> The phone model consists of id, name, version, imei, etc. id is the primary
> key as by the rails standard.
> imei is unique but not the primary key. when I update the model from the
> android app I dont have the id, only the imei number.
> The way I see it I have 3 options.

4) Drop the imei column altogether and use that value as the id.

Obviously that means fixing your foreign key refs, etc., so it's some
work, but it simplifies in the long run.

I have an existing 2.3.x app with a non-system-generated varchar
id column (due to a legacy DB schema) and it works just fine.

HTH,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment