Path: news.easynews.com!easynews!cyclone.swbell.net!cyclone-sf.pbi.net!64.42.15.2!HSNX.atgi.net!sjc-peer.news.verio.net!news.verio.net!sn-xit-01!sn-xit-02!supernews.com!postnews1.google.com!not-for-mail
From: 71062.1056@compuserve.com (--CELKO--)
Newsgroups: comp.databases.theory
Subject: Re: Modelling datas and userids
Date: 14 Mar 2002 15:37:30 -0800
Organization: http://groups.google.com/
Lines: 23
Message-ID: <c0d87ec0.0203141537.563fa8fe@posting.google.com>
References: <ea0243b5.0203131228.12d8ecbd@posting.google.com>
NNTP-Posting-Host: 207.8.52.210
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1016149050 21996 127.0.0.1 (14 Mar 2002 23:37:30 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 14 Mar 2002 23:37:30 GMT
Xref: easynews comp.databases.theory:20176
X-Received-Date: Thu, 14 Mar 2002 16:35:21 MST (news.easynews.com)

>>  I started with a CreatedDate and a CreatedBy. Then I added
ModifiedDate and ModifiedBy. Now I need a few more date/name pairs to
track various steps in a publication process. <<

Without any DDL, we can only guess at what you want in this "vague
non-specification"; you are tracking the histroy of something?  What
are the rules of the actions applied to it?  Etc.

CREATE TABLE History
(item_id INTEGER NOT NULL 
         REFERENCES Items(item_id)
         ON DELETE CASCADE
         ON UPDATE CASCADE,
 action_id INTEGER NOT NULL
            REFERENCES Action(action_id)
            ON UPDATE CASCADE,
 action_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
 PRIMARY KEY(item_id, action_id) -- once for each action 
--  PRIMARY KEY(item_id, action_id, action_time) -- same action, many
times
);

Do actions have a duration instead of a creation timepoint?  Etc.
