Closed nelsonic closed 7 years ago
Out of impatience I deleted all tables in the database!
and then the mix ecto.migrate
worked:
When I ran mix test
I got:
there are (were) two _create_video.exs
migrations:
They appear to be identical:
So I deleted one of them.
The migration works but getting an error ERROR 42P07 (duplicate_table): relation "videos" already exists
when attempting to run the tests:
This is an exceptionally frustrating error message because the debug log is utterly useless!! 😢 There is no indication as to where in the (my) code we are attempting to re-create the "videos" relation...! 😧
"solved" it by deleting all tables in the rumbl_test
database and re-running mix test
:
at least now the tests run but one of them is failing:
This might have been an issue to do with not "rolling back" your duplicate migration. If you want to undo a migration you can call mix ecto.rollback
which will completely remove it. You can also roll back to specific migrations using:
mix ecto.rollback -v [timestamp]
Googlededed for the error: no function clause matching in Ecto.build_assoc/3
foundeded: https://elixirforum.com/t/no-function-clause-matching-in-ecto-build-assoc-3/1123
which is exactly the error I am seeing. so now reading through the replies ... 👀
After a bit of digging found the answer on: https://forums.pragprog.com/forums/393/topics/14291
duplicate resources "/videos", VideoController
in scope "/"
and scope "/manage"
of router.ex