I am looking for some advice on version control with our databases.
We currently have a few developers all running their own local development versions of website projects.
These websites are also available for the client to see on a staging server.
The issue I am having is that I may get the latest database from the stage server, then make changes to this on my local copy.
But in the meantime, the client has amended their CMS on the staging.
I was reading about SQL replication, is this a good idea? I was thinking that whenever a change is made on the staging site it will replicate to our local server and update that database.
Anyway, thoughts are appreciated.
If each developer gets a slave of the master (staging) and do local changes they will probably break replication as replicated statements will break if the slave schema isn’t compatible. So all changes have to go on the staging server, and all developers would get them and if they haven’t the latest source the source would break… So, while that might work I think it will be difficult.
I would suggest to do database changes in files that each environment have to run. There are a few you could investigate liquibase and dbdeploy