Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Php Db synchronization

I have a local server where I do all my testing and work. Once I am done, I simply upload the db schema along with the relevant code. However the problem arises when I make some changes to the schema. I have to manually type the "alter table" query on my live server.

Is there a way to get the incremental changes that took place in the db schema so that I can just apply the new ones? Or do I have to manually keep track?

If I use mysqldump, then it produces the schema of the final db (not with alter table etc).

Thank you very much.

like image 614
Alec Smart Avatar asked Apr 23 '26 16:04

Alec Smart


1 Answers

I keep the delta sql scripts which go to the production server together with the new code. I script everything so the change of the application from version X to version Y is "automatic". Some people also have undo scripts in case something goes wrong.

like image 176
cherouvim Avatar answered Apr 25 '26 05:04

cherouvim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!