Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004

    Arrow Unanswered: 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 :-)


  2. #2
    Join Date
    Feb 2004
    Siggenthal, Switzerland
    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.


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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts