Re: Application Design: Where to implement historical revisions of objects - Mailing list pgsql-php

From Chris
Subject Re: Application Design: Where to implement historical revisions of objects
Date
Msg-id 4654DD7C.3000103@gmail.com
Whole thread Raw
In response to Application Design: Where to implement historical revisions of objects  ("Colin Ross" <colinross@gmail.com>)
List pgsql-php
Colin Ross wrote:
> Summary:
> In a situation where the business model dictates that a certain entity
> or class of entities should support the viewing of and differencing of
> historical revisions of the data (read properties) contained in the
> entity should be supported. Should the logic for the creation and
> viewing of this historical information be implemented in the application
> itself

If you are only going to be using postgres, do it with a trigger so you
don't have to remember to do it in the application (it's quite easy to
forget something like this).

If you have to support other databases as well, then make sure they
support triggers.

If you have to use a database that doesn't support triggers, then that
makes the decision for you (eg supporting mysql 4.1).

If you have to do it in the app, it's still quite easy:

insert into history_table (...) select x,y,z from orig_table where id='X'

Done :)

--
Postgresql & php tutorials
http://www.designmagick.com/

pgsql-php by date:

Previous
From: "Colin Ross"
Date:
Subject: Application Design: Where to implement historical revisions of objects
Next
From: Michelle Konzack
Date:
Subject: Re: Application Design: Where to implement historical revisions of objects