I have multiple objects with multiple states. I want to build a timeline for each object. For example: an object might have a created, submitted, processing and success state. I would like to store when the object's state changes. I have 2 different solution in mind.
For each object model add columns with
[status]_atname. In the above case the model will have
Store the current object state in the object model. Create a separate table which stores the object state with time. In this case even if I want to add more states to objects it will not change my db schema.
What is the best way of storing the data? What are the pros and cons of the above solutions? Open for other solutions also.