Re: Modelling datas and userids
From: --CELKO-- <71062.1056_at_compuserve.com>
Date: 14 Mar 2002 15:37:30 -0800
Message-ID: <c0d87ec0.0203141537.563fa8fe_at_posting.google.com>
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
);
Date: 14 Mar 2002 15:37:30 -0800
Message-ID: <c0d87ec0.0203141537.563fa8fe_at_posting.google.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. Received on Fri Mar 15 2002 - 00:37:30 CET