On Oct 27, 1:42 pm, Han Holl <[EMAIL PROTECTED]> wrote: > > Primary key fields are restricted by default. Use > > Film.unrestrict_primary_key. > > > Jeremy > > Ah. So you can only use Model.create(values) if there are _no_ primary > keys ?
No, you just use unrestrict_primary_key and then things work fine. > I can understand a reluctance to _update_ a primary key but surely to > create a > record this is a rather strange restriction ? > In my, not too extensive, database experience there tends to be a > primary key always. Sequel's preference is for surrogate keys, which should never need to be specified by the user. People who use natural keys are probably going to want to use unrestrict_primary_key. > And in the last working case, isn't the restricted key set anyway ? > > Don't you agree that making a distinction between update and create > makes sense? If you use surrogate keys, you shouldn't be specifying primary keys on creation either. Jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
