DB structure to be able to revisit the past value's of a thing

Hi all,

I’m currently working on a DB in which I have a data type called “player”. The data of this player gets updated every two weeks. However, it’s necessary for me to “go back in time” and retrieve the past values of a particular player.

What would be a good DB structure to solve this? The ideal outcome would be to have different “versions” of a player for every two weeks.

Curious about your ideas! :slight_smile:


You could add a date field.

If the date is empty then it is current. Otherwise it had the date it was updated.


I dont know if I understood right but The ideal is:

You can create field called playerversion and everytime this table is updated, you update this field with something like 1,2,3…etc or v1,v2…etc for each two weeks.

When you want to retrieve data from specific player Just fieltered that field.


Hi Nigel, that’s such a clean solution. I like it! Now I just need to find a good way on how to make this happen when I grab the data from the API and store it in the DB. :slight_smile:

PS: Cool Podcast with Jacob! Watched it two days ago. :wink:

1 Like

Thanks. Jacob is one smart cookie.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.