Yeah it's super confusing, especially since mix releases are now a thing, but weren't before.
I've heard Chris McCord (the author of Phoenix) say he doesn't use Elixir releases in production in most of his consulting company's client work. He talked about it in some podcast like 6 months ago. I think they just run the same mix command as you would in development but he wasn't 100% clear on that.
But yeah, it's not easy to reason about it, and also if you decide to use releases it's a bummer you lose all of your mix tasks. You can't migrate your database unless you implement a completely different strategy to handle migrations. But then if you ever wanted to do anything else besides migrations that were mix tasks, you'd have to port those over too.
That's not true at all. Mix Tasks are just code. Assuming you stashed them in /lib (or someplace that elixirc reaches) you can call them in a release using eval.
I've seen a bunch answers around having to jump through larger hoops to get to run mix tasks in releases. Are all config options still available to be read in mix tasks that are called that way? What about Mix functions like Mix.env()?
If you Google around the topic of database migrations in Elixir releases you'll find like 5 different ways to do them with no clear "this is the best answer".
Mix doesn't exist in releases. You can get config options like normal, but not `Mix.env/0`. You can compile your current env into a config option though, and use that at runtime.
I've heard Chris McCord (the author of Phoenix) say he doesn't use Elixir releases in production in most of his consulting company's client work. He talked about it in some podcast like 6 months ago. I think they just run the same mix command as you would in development but he wasn't 100% clear on that.
But yeah, it's not easy to reason about it, and also if you decide to use releases it's a bummer you lose all of your mix tasks. You can't migrate your database unless you implement a completely different strategy to handle migrations. But then if you ever wanted to do anything else besides migrations that were mix tasks, you'd have to port those over too.