php - What's the best way to implement a "soft" save or modification workflow? -
I'm working on an MVC based web app on LAMP, which records only a "better" user (normal user Changes can be made but they apply only after this approval)
There is only one table in which this must be, say "Events":
Events - ID - Name VARCHAR - start_date DATETIME - Guest INTEGER
Each time one of the features of an event is modified by the "normal" user It is, these changes are not made official until a modification (and is not possible) from this "super" user. First of all I have one of the following options:
- In addition to the ID, duplicate each column, the name "name" is called name_temp for pending approval modification to catch.
- Create a separate table with duplicate structure and keep all pending approval modifications.
Have you applied it before? What is the best way to do you? Even more: Is there a pattern of such a problem?
thanks !!!
PD: I need to keep the "old" record as long as the new is approved, it was ..
Let me add my vote to another table" approach - as both other respondents said, "proposed changes" in the master table (which means its schema, every query on it, etc. , Etc.) above all the heads and shoulders.
All the desired circumstances in the assistant table Typing and processing them (if they look at certain conditions, apply them to the master table) is actually a common pattern later, when you need a master table, then only to change in some time, the proposed change Any time can come, and in other situations, eg when written on master table, it is very expensive (lock dispute or whatever), but write an change Is not more expensive than food, or the proposed change is valid, it takes a lot of time (you can classify your use case as an extreme case, the latter category, because in your case the person will see the proposed change Required - computer is very slow with standards - -).
Comments
Post a Comment