Agreed on testing with real data. Even then, sometimes migrations can be brittle when unexpected data is loaded from a new environment.
I'm curious how folks who aren't using an ORM handle this. We've used Goose before for schema migrations, and can add .go migrations that handle more complex data-migration tasks. It always feels more brittle, and I wonder if there's a pattern that I'm missing here. Is there a better way for non-ORM users to handle data migrations?
For complex operations we use plain sql files.
Always test on staging with the live data and schema!