I am currently working on a personal project where I automatically transform a database description file to a sqlite database.
This works fine but this is very "basic": each time I modify the description file, I delete and recreate the database file (losing all my previous tests datas).
I want to improve the system in 2 ways:
1) keep as much as possible previous version data into the new database schema
2) be able to go back in time (restore a previous description file and database schema, but still keeping as much data as possible)
So just copying the description file + database file for each schema change is not an option here (because when doing a "go back" if I just restore the previous files I would lose any new data entered afterward).
Possible schema operations are:
* add table
* delete table
* rename table
* add field in table
* delete field
* rename field
* (eventually change field type, but this one is more tricky)
Do you have any idea/suggestion on how to do that with PHP in a "simple" way ?