I have a MySQL table that updates from an API daily, but now I want to track a specific field that has been updated from the API. I want to update the row with the current field(value) change and keep the old field(value) in another field. Could somebody please point me in the right direction and what would be the best practice for this?
Table (original)
---------------------------------
|ID | Input Date | Expired Date |
---------------------------------
| 2 | 2017-05-17 | 2017-12-19 |
---------------------------------
| 3 | 2017-07-09 | 2018-05-19 |
---------------------------------
Table when updated (current)
---------------------------------
|ID | Input Date | Expired Date |
---------------------------------
| 2 | 2017-05-17 | 2018-05-28 | <----- ID 2: Expired Date updated
---------------------------------
| 3 | 2017-07-09 | 2018-05-19 |
---------------------------------
Table updated and keeps old field value
------------------------------------------------
|ID | Input Date | Expired Date | Old Exp Date |
------------------------------------------------
| 2 | 2017-05-17 | 2018-05-28 | 2017-12-19 |
------------------------------------------------
| 3 | 2017-07-09 | 2018-05-19 | |
------------------------------------------------
I hope this made sense a little, please help..Thank you so much:)