[thelist] methods for creating a history table

William Adamsen williamadamsen at yahoo.com
Fri Feb 7 19:31:01 CST 2003


Built something virtually identical in CF and still
have a live demo and pitch at http://imagoterra.com
See page 18 of the pitch.

My history table used UUID for all primary keys which
meant all were unique regardless of table .. but it
could be adapted easily for integers.  I didn't bother
with the crud details and simply dumped the entire
form into the column in xml - clearly not meant for
huge records.  This made it easy to compare the values
for each unique record.  Easier to see than describe.
Try the username\password combo test\test and use the
user admin to compare the edited changes for that
user.

Primary benefit of one table is easier coding, easier
archiving.

strObjectIDpk		varchar		35
strObjectType		varchar		50
dteLastUpdate		datetime	8
strUpdateReason		varchar		200
strUpdateForm		varchar		4000
strLastUpdateUserIDpkfk	varchar		35
ID			int		4



--- RUST Randal <RRust at COVANSYS.com> wrote:
> I'm adding a history table to my db. It has the
> following columns:
>
> historyID int(5) unsigned not null auto_increment
> primary key,
> table char(20), #this is the table that was changed
> recordID int(5), #id of the record that was changed
> changeType char(20), #insert, update or delete
> columnsAffected char(60), #??
> changeDate date, #date the record was changed
> changedBy char(30), #id of the person that made the
> change
>
> I can pull all of the data that I need except for
> the "columnsAffected."
> Is there an easy way to do this? What I'm thinking
> right now is that I
> might need to match the old data with the new data
> and create an array
> with the names of the columns that don't match. But
> I don't really want
> to have to do that.
>
> ----------
> Randal Rust
> Covansys Corp.
> Columbus, OH
> --
> * * Please support the community that supports you.
> * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip
> Harvester
> and archives of thelist go to:
> http://lists.evolt.org
> Workers of the Web, evolt !


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the thelist mailing list