Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to run Ecto migrations in Elixir/Phoenix from an `iex -S mix` or production console
# How to run Ecto migrations from IEx console... Examples
# preliminaries assumed in the following code, change to fit your environment:
alias YourAppName.Repo
your_app_name_as_atom = :mpnetwork
downto_version = 20170724182558
# Down:, "priv/repo/migrations/", :down, [to: downto_version])
# Up:, "priv/repo/migrations/", :up, [all: true])
# In production when not sure if working directory is inside app dir:, Application.app_dir(your_app_name_as_atom, "priv/repo/migrations"), :down, [to: downto_version]), Application.app_dir(your_app_name_as_atom, "priv/repo/migrations"), :up, [all: true])

This comment has been minimized.

Copy link

astavonintsc commented Mar 3, 2020

is there a way to run mix ecto.create from console?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.