Working with MySQL I have a database with many tables and complex relationships.
Each table with data has a year
and a month
field for versioning purposes.
Is there a simple way to duplicate the entire set of data into the original tables given a year
and a month
, maintaining and relationships and incrementing the year
and month
fields as needed.
Currently I am doing this programatically, but the script can take a while to run as it needs to do a lot of validation on the rows I am copying.
I am open to any ideas on a better way to version this data also as I am not convinced this is the most efficient way.