Answer the question
In order to leave comments, you need to log in
What are the reasons why the migration fails?
I created a model,
I am running a migration
, what could be the reason that the migration is not suitable?
I checked the latest version of the migration - it says that it passed
but the data cannot be written down
, I attach everything in screenshots
Answer the question
In order to leave comments, you need to log in
On the first screen, everything is OK, what you programmed is what you got. If you changed something in the migration file, then you need to rollback the migration back db:rollback and then apply it again. Or even start from scratch: db:drop + db:create + db:migrate
And why did you decide that the migration does not work? You just have a deprecation warning. As far as I know, if you want to manually bring the test database schema into line with the development schema, you need to use the rake db:test:prepare command.
Judging by the screenshot in the question and the screenshot from the diagrams, you created a model and immediately migrated. Only then did they write code to it.
vsuhachev gave a suitable solution
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question