I heard opinions for both pro and con; I wonder what you people vote for… Also feel free to add some details/reasoning as an answer!
I just recently started to use database migrations in a project that I worked on, and prefered to keep the migrations together with the code, since this way I could, for example, do a commit with all the changes done on the code itself and on the database.
Almost every site we build at work has a migration from some other platform to WordPress. We commonly script migrations in custom plugins using WP-CLI which we enable during the migration and turn off immediately afterwards.
We keep the code in our Git repos as historic documentation of how the migration worked, in case there are any questions why values were stored in certain fields or why we mapped an existing value to a different one.
Also, it's code the client paid for, and they get warm fuzzy feelings from knowing they have something to show for it.
Divyendu Singh
I get the job done!
I voted for together with code because this