Upgrading ecto 2.0 to 3.0

I am upgrading my application to ecto 3.0. These are my some deps

[
  {:cors_plug, "~> 1.2"},
  {:phoenix, "~> 1.3"},
  {:phoenix_pubsub, "~> 1.0"},
  {:phoenix_ecto, "~> 3.0"},
  {:ecto_sql, "~> 3.0"},
  {:postgrex, "~> 0.14.0"}
]

I got this error for db_connection dep in mix lock file. when running mix deps.get

Failed to use "db_connection" because
  ecto (version 2.2.10) requires ~> 1.1
  ecto_sql (versions 3.0.0 to 3.0.3) requires ~> 2.0

if i bump the version of phoenix ecto to 1.4 . I got different deps errors

  Failed to use "ecto" (versions 3.0.4 and 3.0.5) because
    ecto_sql (version 3.0.3) requires ~> 3.0.4
    ex_machina (version 2.2.2) requires ~> 2.2 or ~> 3.0
    ex_seeds (version 0.1.4) requires ~> 2.2
    phoenix_ecto (version 4.0.0) requires ~> 3.0
   How to upgrade the db_connection 

Thanks

Hi,

when I upgraded I followed the instructions in this gist…

https://gist.github.com/chrismccord/bb1f8b136f5a9e4abc0bfc07b832257e

The issue is in the ex_seeds library which requires Ecto 2.2. You need to either override it or update it too (or drop it).

2 Likes