I have asked this question on ElixirForum as well: I need to run `mix ecto.reset` in production - Questions / Help - Elixir Programming Language Forum
My problem is that I am currently heavily iterating on my database models, so I will end up with scores or hundreds of migration files that are mostly just tiny tweaks if I keep building up migrations.
But if I instead edit a migration to make it do exactly what I want, then my deployment complains because the migration has already been run.
I’m not really in production, so I don’t mind just dropping all my data and re-running my migrations from the beginning, so I wrote a script to do that, but when I try to run the script upon deployment I get an error:
{:error, "ERROR 55006 (object_in_use) database \"myapp\" is being accessed by other users\n\nThere are 11 other sessions using the database."}
I tried to suspend my app so I could run my script without a live version of my app holding the connections, but then I get the error:
Error App 'myapp' is currently suspended. Resume before deploying.
So… how can I just drop and re-build my database?
Thanks.