History Tables and Undo

A place for users and developers of the Xataface to discuss and receive support.

Postby Aoirthoir » Mon Jul 10, 2006 3:13 pm

A lot of our tables get changed by temps. Sometimes those changes are incorrect of course. We've had them change entirely wrong records. So we are setting up a history. Basically we will be usign MySQL triggers which will copy a record every time it is written, from the first add. The table it copies to will have all of the fields of the original table, plus some additional fields for tracking, like the date, the user who made the change, such like that. In order to view the tables we will be setting up a simple dataface relationship. Currently, if we need a record back, we will just do a straight SQL statement to copy it over. In the future with the new actions abilities in Dataface, we should be able to make the process a simple point and click function.
Aoirthoir
 
Posts: 420
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Mon Jul 10, 2006 3:16 pm

If you can post some sample code (especially for the mysql trigger part) I'm sure that this sort of thing would be of interest to a lot of users. Makes for a nice recipe, at least.

Thanks for posting this Aoirthoir!
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Aoirthoir » Mon Jul 10, 2006 3:50 pm

In Sign Language, thanks for thanking me Mr. Steve. (That's how you say your welcome in sign)

Anyhow My gal and I should be working on the triggers tonight. So I will post as soon as I have something solid.

Also, do you think a recipes section of the site would be good?

(Actually this is the kind of thing I would like to see in the central repository we were talking about earlier. Currently the code I will be working on will be hard coded SQL for the trigger..but if it is possible I would like to move it to a generic stored procedure which can be called from any trigger...I dont know how to do that just yet.)
Aoirthoir
 
Posts: 420
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Mon Jul 10, 2006 5:42 pm

>Also, do you think a recipes section of the site would be good?

How about posting it in the "how-to" section of the documentation?
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Aoirthoir » Mon Jul 10, 2006 7:30 pm

Sounds good. When we have it all done I will post it.
Aoirthoir
 
Posts: 420
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 19 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved