I would go with a product_history table where I'd store all the changes made. I would us a table trigger for this so I don't have to handle it with php.
Oct 18, 2020
1
Level 16
Database Design : Timestamp column or saperate history table.
In case of database design requirement where it is required to record changes for records in an entity? For example,
-> Record changes the user make in his bank details
-> Price and quantity changes for a products.
As far as I know there are two possibilities here. I can add a timestamp column and add merge it with primary key. For example PRIMARY(product_id, timestamp). And another way is to create a product_history table.
What are the pros and cons of both approaches?
Level 73
1 like
Please or to participate in this conversation.