Re: Saving Changes to Text Body
Date: 19 Sep 2000 14:54:47 GMT
Message-ID: <slrn8sevh5.1kav.criscokid_at_deepcore.gsm>
In article <RPKx5.12$Lf6.666_at_news-east.usenetserver.com>, Cory L Hubert wrote:
> Hello. I am trying to find a standard way of storing only the
>differences made to a body text. Then on demand call all the recent
>changes and concat the current version. Also I would like the ability to
>cancel or roll back a change. Any ideas for a Data Model that could
>support a feature like that?
I do a similar thing at work with the office's policy and procedure manual.
My schema is something like this:
create table documents (docid varchar(200), startdate datetime, enddate datetime, documentsource longtext);
To retrieve a document, I just do this:
select * from documents where docid = '<the doc I want>' and startdate < <when> and enddate >= <when>;
<when> is the point in time that I want to see the document.
To delete a document, you find the "current" revision of it and change the enddate to now(). To edit a document, you do the same thing as a delete, followed by an insert with startdate = now() and enddate = whenever. Since this doesn't really depend on the current time, you can even add documents to the system that will not appear until a specific date.
Hope that helped!
- Dave Kimmel criscokid_at_v-wave.com ICQ: 5615049
