Ask HN: How does your development team handle database migrations?
1–10 of 150 posts
Re: Ask HN: How does your development team handle database migrations?
#2Re: Ask HN: How does your development team handle database migrations?
#3Re: Ask HN: How does your development team handle database migrations?
#4We commit the migrations along-side the application code and in our case we use FlywayDB [1]. The only down-side is that this tool doesn't perform roll-back operations automatically. You can always do them by writing another migration that goes forward to the past.
Another popular DB migration tool is Liquibase [2]. I don't have much experience with this tool as it doesn't fit our build pipe-line as well but it does support and encourage defining a roll-back for each migration.
[0] https://www.martinfowler.com/articles/evodb.html
EDIT: HN is the new StackOverflow? I think this is a really important question for development teams and yet I could see it being closed due to the "Questions asking for tool or library recommendations are off-topic for Stack Overflow ..." rule. Sad!
Re: Ask HN: How does your development team handle database migrations?
#5It’s always one of the first things I miss when I have to work on a non-rails codebase.
Re: Ask HN: How does your development team handle database migrations?
#6We use a staging environment, so CD deployed migrations are always run at least once before running on production.
Migrations have to be written so that currently deployed code will work after the migration. Eg, to rename a column, add+copy, deploy, then in a second migration drop the column.
Re: Ask HN: How does your development team handle database migrations?
#7Re: Ask HN: How does your development team handle database migrations?
#8Re: Ask HN: How does your development team handle database migrations?
#9Re: Ask HN: How does your development team handle database migrations?
#10At my previous job we either didn't migrate and wrote application level transforms that would update records as they were encountered by users (mongodb) or we had a custom built migration system that ran JavaScript snippets on our shards. The migration system was miserable to work with and it was hard to debug the code on stage in such a way that would allow us to anticipate whatever might be on prod...