ASK HN: Why Database migrations aren't handled like Git?
You basically write how to change state.
In Git, you change the file and git internally figures out what has changed and then creates a commit. If you push it and then others download the changes they also reach to new state without having to delete everything. Only difference is..
You made changes to final state and Git automatically detected what changed. Git figures out how to change the state.
What you do in DB migration is equivalent to typing out Git commits manually on what files to change and how to change them.
Ex: Delete lines 22-30 in file abc.js and new lines at 10-15 which are .................. Instead of you just editing the abc.js.
See how stupid that looks. That's how stupid SQL migrations look to me.
Instead of me just updating schema and have some program figure out changes and propagate them to related parties. I've to manually write what change and how it changed in SQL statements.
Benefit:
New Users wont have to run 3000 migrations they can start with final state.
Humans wont have to write migrations by hand and do more productive things with their limited lives.