Hi,
In the release module, in rollback fn, can I know how does one get the version or from where? What is the type of version?
def rollback(repo, version) do
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version))
end
Thanks
hst337
2
What do you mean by “release module”?
version
is an integer, that matches the timestamp in the migration file name. For instance, this example from the docs:
bin/my_app eval "MyApp.Release.rollback(MyApp.Repo, 20190417140000)"
It’s also the value stored in schema_migrations
for each completed migration.
3 Likes