Ecto / Postgres behaving strangely

So I have been playing around a bit , and I wanted to add a another table for the application to enjoy.
when I run the migrate task everything looks all fine and dandy until I try to either delete or update the table.

I set up a test project with the basic gen.html task.

it seems to be random what controller functions are affected.

what am I doing wrong ?

1 Like

What errors you receive when you try delete or update?

1 Like

No Errors everything looks good.

Oh and Its ecto with phoenix.

and if I drop and migrate again it works as normal , sometimes I have to drop several times.

1 Like

So what’s then is root problem what you are trying to solve?

2 Likes

I can`t drop a database in production.

1 Like

If there are no errors and you say that after you drop everything and migrate again and then it works well. I would guess that your drop migration was recorded schema_migrations before you maybe added drop table code. And that’s why when you run migration it says everything is good, however, this migration is already in schema_migrations table and it will not run.

This is my guess, to help you more, I would need more information. What mix ecto.migrate returns for you, your schema_migrations data etc.

2 Likes