We are actually a group of students developing an internal application for a company, and we need to change SQL data everyweek.
We are planning to use Symfony console command made by ourself (so in PHP) that will be executed by a windows task everyweek. The main problem is to know how we could handle a system like this in our database.
There would be the actual value (1, 2 or 3) , and the cycle for each user to store (cycles don't have a fixed length, but the maximum should be 4), but we think this is too big to store this type of data.
We were thinking about something like this for an example :
╔═════════╦══════════════╦═════════╗
║ id_user ║ actual_value ║ cycle ║
╠═════════╬══════════════╬═════════╣
║ 1 ║ 1 ║ [1,2,3] ║
║ 2 ║ 2 ║ [2,3,1] ║
║ 3 ║ 2 ║ [1,2] ║
╚═════════╩══════════════╩═════════╝
After the script has been runed, we should get this :
╔═════════╦══════════════╦═════════╗
║ id_user ║ actual_value ║ cycle ║
╠═════════╬══════════════╬═════════╣
║ 1 ║ 2 ║ [1,2,3] ║
║ 2 ║ 3 ║ [2,3,1] ║
║ 3 ║ 1 ║ [1,2] ║
╚═════════╩══════════════╩═════════╝
Are we going in the right directions ? Is there a more efficient/easiest way to do this type of thing ? This is actually prototyping, so if you have other table schema in mind that could be better, we are listening to any suggestions.