I have some table and records in a database, that I use to manually test my (PHP) code. Suppose, I’d like to share these records and table structure (e.g: with other developers); if some model changes or new table added, everyone will aware.
How do you integrate to your development process this need? My idea is on every commit dump the DB into a file, and commit that file as well, after the script made sure it’s modified. And on update, update this file as well and reload the other development db. This could be possiple via eclipse’s external tool function, but I feel this a bit hacky.
How do you deal with test-data in database, if it should be version controlled/shared?
There are numerous methodologies for handling test data, but the process we use is as follows:
You will need to maintain your data, obviously, as your database changes, which may mean refactoring your data files when new not-null columns get added. However, once you have this system in place, all of your developers can easily grab all the SQL from our source control and generate their own database with test data easily.
The alternative to this would be to maintain a development database for all developers, which we also have. This way, you have one “gold” copy of the development database with the latest schema changes and test data.