If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > undo system with MySQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-17-04, 05:05
willi.st willi.st is offline
Registered User
 
Join Date: Feb 2004
Location: Vienna/Austria
Posts: 7
Arrow undo system with MySQL

hi forum user :-)

i want to implement an undo/redo system for an application. The data for this application i will get from my MySQL database. The data are hierarchical data similar to filesystem-data. I implement it in the database with the nested set model.

So here is my question: Does anyone out there have an idea how i could use the database to make an undo/redo system. For example: When i delete an entry (or a complete subtree) i want to 'undo' this action (if posible unlimited undo's).

i would be grateful for any idea from you :-)

Willi
Reply With Quote
  #2 (permalink)  
Old 02-19-04, 03:43
walter71 walter71 is offline
Registered User
 
Join Date: Feb 2004
Location: Siggenthal, Switzerland
Posts: 19
Hello Willi

I solved this with the help of history tables.

I created functions for update and delete, which backup the
original value with a modifier reason comment into the history table and
then execute the udpate or delete.

So you have the complete history of changes from all your data.

Example:

data(data_id, data_text)
history(hist_id, reason, timestamp)
data_hist(hist_id, data_id, data_text)

Walter
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On