On Nov 14, 5:07 am, Gary Doades <[email protected]> wrote:
> On 13/11/2010 9:48 AM, 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 
> > herehttp://sequel.rubyforge.org/rdoc/classes/Sequel/Database.html#M000510
> > andhttp://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 can only have one primary key.  That is what he word
primary means.

Second.  You do not need, and really do not want, a composite primary
key. What you need is a composite index with a uniqueness
constraint.

Third. When you say "no more than one event can occur at any time" are
you saying that no more than one event can 'start' at a given time but
that events can nonetheless overlap.  Say, one starts at 09:00 and
runs to 11:00 but another starts at 10:15 and runs until 10:45?  Is
that allowed?  If not, then your constraint as given is insufficient
for your purpose.

-- 
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.

Reply via email to