Phx.gen.html belongs_to/has_many error

That’s how Ecto works. Whenever you add an association, you’ll get both fields. This works nicely with preloads:

post = Repo.get(Post, 123) |> Repo.preload([:author, :topic])
# You can now access the associated data
foo = post.author.name