From: John W Higgins Date: 2010-11-13T13:34:16+09:00 Subject: Re: Ruby-Sequel - Sqlite3 table schema --000e0cd4030e0f9deb0494e7b8d1 Content-Type: text/plain; charset=ISO-8859-1 Good Evening, On Fri, Nov 12, 2010 at 7:35 PM, flebber wrote: > Hi > > Looking for a little assistance. I am trying to create a basic > database schema using Ruby, Sequel and Sqlite3. > > I am reading here > http://sequel.rubyforge.org/rdoc/classes/Sequel/Database.html#M000510 > and http://www.firstsql.com/tutor6.htm . > > The only thing that would be unusual about my db is that I want to use > two primary keys time & date as no more than one event can occur at > any time though multiple events could occur on a day. I am not > understanding in sequel how to correctly create a db with multiple > keys? Or should I just be generating a random number to create a key > which references date and time? > > First you would be better off in the Sequel mailing list here - http://groups.google.com/group/sequel-talk As to your question - you create the two fields as normal and then add primary_key([:date_col, :time_col]) The best resource for the docs on schema generation is here http://sequel.rubyforge.org/rdoc/classes/Sequel/Schema/Generator.html John --000e0cd4030e0f9deb0494e7b8d1--