> I guess this question is familiar to many of you and since I came > across it for the first time now I'm soliciting best practice and > strategy advice. > > I have a set of tables with all sorts of relationships between them. > Many times items get deleted, but I'd like to make sure that I can > undo a delete later (not in the same session, but let's say a week > from the delete). Is there an obvious one way to do this? > > What I thought about is creating new tables for each already existing > table, something like deleted_zoo for zoo, deleted_animal for animal, > etc. Then when I delete something from zoo (which cascades down to > animal) I would override the appropriate method that would not only > delete the item from the table but would also insert it into the new > deleted_XXX tables. Then I could copy back from the deleted_XXX table > to the original XXX table if I want or I can delete it from there > permanently. > > How would you guys approach this problem?
Just one more comment: I thought about adding a field 'deleted' (defaulting to False) to every table for which I'd like to have undo behaviour and then when I delete an object I'd set delted = True. The problem with this solution is that for every single query I make I'd need to add the clause ( table.q.deleted = False ). And if I forget this deleted fields can leak. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss