Reset test db after migration

After creating a migration I run into a problem that the test env database is not the same as production.

I kind of remember having had the problem before but I can’t google the solution.

How can I fix the test env setup so that I don’t run into this problem in the future?

Not sure what you mean, is not the same in production or locally? Did you run migration on both?

Do you mean like dropping and resetting the database in dev?

mix ash_postgres.drop && mix ash_postgres.create && mix ash_postgres.migrate

You can add that to your aliases in mix.exs

defp aliases do
  [
    "ash_postgres.reset": ["ash_postgres.drop", "ash_postgres.create", "ash_postgres.migrate"]
  ]
end
1 Like