We wish to implement a "trash" functionality so that Wiki items, Tickets, etc. are not irrevocably deleted, but are instead held in a trash area, available to be re-instated.
There are a number of possible solutions we have discussed, with the example being wiki pages: 1. Versions < 1 Alter the DELETE to be an UPDATE which decrements the version to the next available number below 1. Alter the SELECT to take only items with versions above 0. I attach a diff implementing solution (1) in a rudimentary manner 2. "deleted" column, version skipping Add a "deleted" column. Alter the DELETE to be an UPDATE which adds metadata to a "deleted" column which is, by default, NULL. Alter the SELECT to take only items where deleted IS NULL. Tweak the save() method to inspect the DB for its next version number, rather than simply using "self.version += 1" -- allowing versions to be skipped. 3. "wiki_trash" table w/copy-on-delete listener Create a new table "wiki_trash" containing trashed versions of wiki pages. Add a listener for Wiki deletion events and insert (with the next available version in wiki_trash) the page into wiki_trash. Allows the deletion of wiki page to go through as normal, and does not require altering of the current SELECT. What comments do you guys have on the outlined solutions? Is any of them preferable? Perhaps there is an alternative solution you would like to discuss? Best regards, Adam Piper _________________________________________ Logica - Be Brilliant Together Kingston House, Towers Business Park, Wilmslow Road, Didsbury, Manchester, M20 2LX, UK T: +44 (0) 161 438 8069 F: +44 (0) 161 438 8100 E: [email protected] www.logica.com Logica UK Limited Registered in England and Wales (registered number 947958) Registered Office: 250 Brook Drive, Green Park, Reading RG2 6UA, United Kingdom Please help Logica to respect the environment by not printing this email / Pour contribuer comme Logica au respect de l'environnement, merci de ne pas imprimer ce mail / Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei, die Umwelt zu schützen. / Por favor ajude a Logica a respeitar o ambiente nao imprimindo este correio electronico. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. -- You received this message because you are subscribed to the Google Groups "Trac Development" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.
trashable_wiki.diff
Description: trashable_wiki.diff
