

Ask HN: (What) do you use (for) automatic DB migrations in PHP? - ron77

So I finally wanted to organize things better and handle DB migrations in more automatic way. I did some research and surprisingly didn't find what I was expecting to find.<p>I'd like a tool which can create migration files automatically basing on actual DB tables. Let it be aware of previous DB schema, examine new DB schema, create diffs and put them in a migration file.<p>I found many great migration solutions which handle managing revisions, executing migrations up and down, but all of them require you to manually write code for DB changes. There has to be something better than this.<p>What do you recommend?
======
cjensenius
mysqldiff.pl generates the diffs you refer to, but I never implemented a fully
automated process, because I never trusted that nothing would go wrong. That
does not stop me from using the output in the migration script though, so you
should be able to do the same.

~~~
ron77
Thanks, I'll try it!

Sure, I don't mean a fire&forget thing but to review migration commands. But
diffs should be fine too - they'll actually require a programmer to review it,
even accidentally when pasting the output to the migration script.

