[mythtv] database schema
Chris Palmer
mythtv at zencow.com
Sat Mar 15 03:51:40 EST 2003
I was thinking that this should apply to all of the current
TIMESTAMP fields. There are currently no DATETIME fields,
but I can't see a use for any of them to be TIMESTAMP fields,
since none of them have to do with keeping track of when a
row of data is updated. They all have to do with show times,
which are known values.
The TIMESTAMP fields also make it difficult to manually edit
the tables, since the database will automatically change the
value of the starttime for a recording, which just doesn't make
any sense at all, especially since it's part of the unique key
to identify a recording.
My guess is that when the schema was first designed, that it
was assumed that the TIMESTAMP datatype was the proper type
based solely on its name. As a datatype it is interchangeable
with the DATETIME field, but it has other specific built-in
functionality which makes it useful for logging/tracking of
database updates.
-Chris
Mike Javorski wrote
> Hmm.. well it depends on what the intention of the field is...
>
> >From the MySQL site:
>
> -- SNIP --
> The TIMESTAMP column type provides a type that you can use to
> automatically mark INSERT or UPDATE operations with the current date and
> time. If you have multiple TIMESTAMP columns, only the first one is
> updated automatically.
> -- SNIP --
>
> If this is what you are going for, then a timestamp is good, if you DO
> NOT want the field to auto-update when the fields is updated or
> inserted, then you MUST use a DATETIME...
>
> To which portion of the SQL Schema are you refering?
>
> - Mike
>
>
>
> On Fri, 2003-03-14 at 17:58, Matt Zimmerman wrote:
> > On Fri, Mar 14, 2003 at 03:11:28AM -0800, Chris Palmer wrote:
> >
> > > I was wondering if there was a reason that the
> > > TIMESTAMP field type was used instead of the
> > > DATETIME field type for all the time/date fields.
> > >
> > > Some things could probably be simplified if all
> > > of those fields were of type DATETIME instead of
> > > TIMESTAMP.
> >
> > I believe that all of the TIMESTAMP fields currently in the schema would
> > make more sense as DATETIME fields. This sounds like a good candidate for
> > some post-0.8 cleanup if you would like to send a patch.
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at snowman.net
> http://www.snowman.net/mailman/listinfo/mythtv-dev
>
More information about the mythtv-dev
mailing list