Recommended way to depreciate fields in ecto schema

Hello,

I am working on a phoenix project that is two years old.
We have some ecto schema with fields that we don’t use anymore but we can not just remove them because they are used in some legacy data.

We have a graphql api, for this part we will use the deprecate

For now I add those information to the @moduledoc

  @moduledoc """
  Define Employee schema

  ## Deprecated fields

    - permissions
    - role
    - image

  """

If you experience similar situation share your way.

Thanks

You can have two Ecto schemas, one prefixed with Legacy containing the old fields and the new one, without them.

2 Likes