From: Glen Holcomb Date: 2008-06-28T03:52:35+09:00 Subject: Re: Sequel primary keys ------=_Part_11674_19736837.1214592898534 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Fri, Jun 27, 2008 at 12:44 PM, Todd Benson wrote: > On Tue, Jun 24, 2008 at 11:01 AM, Glen Holcomb > wrote: > > I posted to the Sequel Google Group but it's horribly slow, assuming it > took > > my post. > > > > Does anyone on here know if it is possible to create a non-integer > primary > > key in Sequel? If so how? Also help with creating a non integer foreign > > key would be great too. I've done some poking through the Rdoc and some > > experimentation and it wants to make everything :integer or > AUTOINCREMENT. > > > > Thanks, > > Glen > > Hey Glen, can you give us an answer about whether primary key and > foreign key can be handled by the designer for certain databases with > Sequel? I'll RTFM eventually, but was just curious if you found out. > > thanks, > Todd > > Yeah, you can. For example: class Computer < Sequel::Model set_schema do primary_key :name, :type => :text, :auto_increment => false varchar :os varchar :ip varchar :mac foreign_key :lab, :labs, :type => :text end many_to_one :lab end # Computer class -- "Hey brother Christian with your high and mighty errand, Your actions speak so loud, I can't hear a word you're saying." -Greg Graffin (Bad Religion) ------=_Part_11674_19736837.1214592898534--